asp.net.ph

SqlDataSource.ConnectionString Property

System.Web.UI.WebControls Namespace   SqlDataSource Class


.NET Framework version 2.0

Sets or retrieves the ADO.NET provider–specific connection string that the SqlDataSource control uses to connect to an underlying database.

Syntax


Inline <asp:SqlDataSource connectionstring = strConnectParameters ... >
Script SqlDataSource.ConnectionString [ = strConnectParameters ]

Property Value


strConnectParameters A .NET Framework data provider–specific string that the SqlDataSource uses to connect to the SQL database that it represents. The default is an empty string ( "" ).

The property is read/write with no default value.

Remarks

The SqlDataSource control can be used with a variety of ADO.NET providers and the syntax of the connection string that is used to connect to an underlying data source is specific to the provider. For information about storing a connection string, see Securing Connection Strings When Using Data Source Controls. For information on valid connection strings, see the ConnectionString property topics for the SqlConnection, OracleConnection, OleDbConnection, and OdbcConnection classes.

If you change the ConnectionString property, the DataSourceChanged event is raised, causing any controls that are bound to the SqlDataSource control to rebind.

Example

The following examples demonstrate how to set the ConnectionString property.

FormView PagerSettings, PagerStyle Example
Run Sample | View Source
Selecting Rows to Edit in a GridView Using a TemplateField
Run Sample | View Source
Master~Details Using GridViews Bound to SqlDataSource Controls
Run Sample | View Source
See Also

ProviderName Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph