OracleConnection.ChangeDatabase(String) 方法

定义

更改已打开的 OracleConnection 的当前数据库。Changes the current database for an open OracleConnection.

public:
 override void ChangeDatabase(System::String ^ value);
public override void ChangeDatabase (string value);
override this.ChangeDatabase : string -> unit
Public Overrides Sub ChangeDatabase (value As String)

参数

value
String

要代替当前数据库加以使用的数据库的名称。The name of the database to use instead of the current database.

异常

数据库名称无效。The database name is not valid.

连接未打开。The connection is not open.

不能更改数据库。Cannot change the database.

注解

value 参数必须包含有效的数据库名称,并且不能包含 null 值、空字符串("")或只包含空白字符的字符串。The value parameter must contain a valid database name, and cannot contain a null value, an empty string (""), or a string with only blank characters.

备注

与另一个 .NET Framework 数据提供程序(SQL Server、OLE DB 和 ODBC)中的连接对象不同,OracleConnection 不支持 ConnectionTimeout 属性。Unlike the Connection object in the other .NET Framework data providers (SQL Server, OLE DB, and ODBC), OracleConnection does not support a ConnectionTimeout property. 将连接超时设置为属性或在连接字符串中不起作用,并且返回的值始终为零。Setting a connection time-out either as a property or in the connection string has no effect, and the value returned is always zero. OracleConnection 还不支持 Database 属性或 ChangeDatabase 方法。OracleConnection also does not support a Database property or a ChangeDatabase method.

适用于