SqlConnection::Database Property
.NET Framework (current version)
Gets the name of the current database or the database to be used after a connection is opened.
Assembly: System.Data (in System.Data.dll)
Property Value
Type: System::String^The name of the current database or the name of the database to be used after a connection is opened. The default value is an empty string.
Implements
IDbConnection::DatabaseThe Database property updates dynamically. If you change the current database using a Transact-SQL statement or the ChangeDatabase method, an informational message is sent and the property is updated automatically.
The following example creates a SqlConnection and displays some of its read-only properties.
.NET Framework
Available since 1.1
Available since 1.1
Show: