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);
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.
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 than IsolationLevel that can be set when the connection is open.
The following example shows how to create a connection and set many of its properties.
ADOConnection Class | ADOConnection Members | System.Data.ADO Namespace | ConnectionTimeout | ConnectionString | IsolationLevel | DataSource | UserID | Password