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.Database

Gets or sets the name of the current database or the database to be used once a connection is open.

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

Property Value

The name of the current database or the name of the database to be used once a connection is open. The default value is an empty string.

Exceptions

Exception Type Condition
BrokenConError The connection is broken.

Remarks

If the Database property is set when the connection is open, it will set the provider's current catalog property. If this property is set when the connection is closed, it will set the provider's initial catalog property.

Note   This is the only property other then IsolationLevel that can be set when 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 | DataSource | UserID | Password | IsolationLevel