SqlConnectionStringBuilder::DataSource Property
Gets or sets the name or network address of the instance of SQL Server to connect to.
Assembly: System.Data (in System.Data.dll)
Property Value
Type: System::String^The value of the DataSource property, or String.Empty if none has been supplied.
| Exception | Condition |
|---|---|
| ArgumentNullException | To set the value to null, use Value. |
This property corresponds to the "Data Source", "server", "address", "addr", and "network address" keys within the connection string. Regardless of which of these values has been supplied within the supplied connection string, the connection string created by the SqlConnectionStringBuilder will use the well-known "Data Source" key.
The following example demonstrates that the SqlConnectionStringBuilder class converts synonyms for the "Data Source" connection string key into the well-known key:
Available since 2.0