dotConnect for SQL Server Documentation
Devart.Data.SqlServer Namespace / SqlConnection Class / Database Property

In This Topic
    Database Property (SqlConnection)
    In This Topic
    Gets or sets the name of the current database or the database to be used once a connection is open.
    Syntax
    'Declaration
     
    Public Shadows Property Database As String
    public new string Database {get; set;}

    Property Value

    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 ("").
    Remarks

    If the query contains no reference to database to which a table belongs, an attempt is made to find the table in database, which name is specified in Database property. If the value of the property is empty, you must include in a query name of a database for every table you use.

    Assigning a value to this property reopens the current connection.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also