Szerkesztés

Megosztás a következőn keresztül:


EntityDataSource.ConnectionString Property

Definition

Gets or sets the connection string that is used to execute the query.

public:
 property System::String ^ ConnectionString { System::String ^ get(); void set(System::String ^ value); };
public string ConnectionString { get; set; }
member this.ConnectionString : string with get, set
Public Property ConnectionString As String

Property Value

The connection string for the query.

Remarks

The ConnectionString property of the EntityDataSource control can be initialized from a named EDM connection string stored in the connectionStrings element of the application configuration file. When the EDM is created by using the Entity Data Model Wizard, a named EDM connection is created in the application configuration file. When a named EDM connection string is found in the application configuration file, the connection is visible as an option in the Configure Data Source wizard of the EntityDataSource designer. For more information, see Configure Data Source Wizard (EntityDataSource Control).

If the ContextTypeName property is not specified, both the DefaultContainerName and ConnectionString properties must be set for the control to create the ObjectContext.

Applies to