Export (0) Print
Expand All

EntityDataSource.ConnectionString Property

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

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Entity (in System.Web.Entity.dll)

public string ConnectionString { get; set; }

Property Value

Type: System.String
The connection string for the query.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1
Show:
© 2015 Microsoft