Mono Class Library: System.Data.SqlClient.SqlConnection Overview | Members

System.Data.SqlClient.SqlConnection.Database Property

Gets the name of the database the System.Data.SqlClient.SqlConnection instance references.

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public override string Database { get; }

Value

Gets a string value representing the current SQL Server database.

Remarks

Gets the name of the current database an open System.Data.SqlClient.SqlConnection is currently connected to.

The SqlConnection.Database is set in the Connection String by supplying either a "database" or "initial catalog" value.

Note: The Database property can only be set when the System.Data.SqlClient.SqlConnection has an open connection to a SQL Server.

Requirements

Namespace: System.Data.SqlClient
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0