EntityDataSource.ConnectionString Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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 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
Available since 3.5
Return to top