IDbConnection.Database IDbConnection.Database IDbConnection.Database IDbConnection.Database Property

定义

获取当前数据库的名称或打开连接后要使用的数据库的名称。Gets the name of the current database or the database to be used after a connection is opened.

public:
 property System::String ^ Database { System::String ^ get(); };
public string Database { get; }
member this.Database : string
Public ReadOnly Property Database As String

属性值

当前数据库的名称或打开连接后要使用的数据库的名称。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.

注解

Database 通过ChangeDatabase使用方法或通过使用 Execute 方法之一传递 SQL 语句, 可以动态更新属性。The Database property can be dynamically updated by using the ChangeDatabase method or by passing an SQL statement using one of the Execute methods. (最初是通过连接字符串设置数据库的。)如果使用 SQL 语句或ChangeDatabase方法更改当前数据库, 将发送一条信息性消息, 然后更新属性。(Initially the database is set by means of the connection string.) If you change the current database using an SQL statement or the ChangeDatabase method, an informational message is sent and then the property is updated.

适用于

另请参阅