System.Data.SqlClient Namespace SqlConnection Class
Returns the name of the instance of SQL Server to which to connect.
Script |
[ string variable = ] SqlConnection.DataSource |
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.
The following example shows the simplest way to retrieve and display the DataSource property of the current connection.
"DataSource: " + myConn.DataSource;
"DataSource: " + myConn.DataSource |
|
C# |
VB |
Show me
SqlConnection Members ConnectionTimeout Database ConnectionString