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




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