asp.net.ph

SqlConnection.DataSource Property

System.Data.SqlClient Namespace   SqlConnection Class


Returns the name of the instance of SQL Server to which to connect.

Syntax


Script [ string variable = ] SqlConnection.DataSource

Property Value


variable Returns the name of the instance of SQL Server to which to connect.

The property is read only with no default value.

NOTE: You can change the value for this property only by setting the associated keyword in the ConnectionString property.

Example

The following example shows the simplest way to retrieve and display the DataSource property of the current connection.

"DataSource: " + myConn.DataSource;
  C# VB

 Show me 

See Also

SqlConnection Members   ConnectionTimeout   Database   ConnectionString Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

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