NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

SQLConnection.DataSource

Gets or sets the name of the database to connect to.

[Visual Basic]
Public Property DataSource As String
[C#]
public string DataSource {get; set;}
[C++]
public: __property String* get_DataSource();
public: __property void set_DataSource(String*);
[JScript]
public function get DataSource() : String;
public function set DataSource(String);

Property Value

The name of the database to connect to. The default value is an empty string.

Exceptions

Exception Type Condition
OpenConVariable The connection is open. You must first close the connection.
BrokenConError The connection is broken.

Remarks

The DataSource property overwrites the cooresponding property within the connection string.

Note   This property is read-only while the connection is open.

Example

The following example creates a SQLConnection and sets some of its properties.

See Also

SQLConnection Class | SQLConnection Members | System.Data.SQL Namespace | ConnectionString | ConnectionTimeout | Database | UserID | Password | IsolationLevel