DbConnection.Database Property

 

Gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened.

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

abstract Database : string with get

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.

A connection typically updates this property dynamically when the current database changes.

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top
Show: