This documentation is archived and is not being maintained.

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; }
<asp:EntityDataSource ConnectionString="String" />

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, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.