System.Data Namespace IDbConnection Class
Returns the name of the current database or the database to be used once a connection is open.
Script |
[ string variable = ] IDbConnection.Database |
variable |
The name of the current database or the name of the database to be used once a connection is open. |
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.
The Database property updates dynamically. If you change the current database using an SQL statement or the ChangeDatabase method, an informational message is sent and the property is updated automatically.
The following example shows the simplest way to retrieve and display the Database property of the current connection.
"Database: " + myConn.Database;
"Database: " + myConn.Database |
|
C# |
VB |
Show me
IDbConnection Members ChangeDatabase ConnectionString ConnectionTimeout