Brief:
System.Data.OleDb.OleDbException and System.InvalidOperationException are throwed when call OleDbConnection.ChangeDatabase(string dbname)
Exception content:
# System.InvalidOperationException : 未设置属性的值,因为提供程序不支持current catalog属性,提供程序不支持current catalog属性集,或者使用者试图获得或设置 Initialization 属性组中不存在的属性的值,且数据源对象尚未初始化。
# System.Data.OleDb.OleDbException : 没有可用的错误消息,结果代码: DB_E_ERRORSOCCURRED(0x80040E21)
Test Step:
# Create database demodb,testdb
# Create oledbconnection to connect demodb
# Call oledbconnection changedatabase method to change database to testdb
Code reference:
{code}
DataUtil dUtil = new DataUtil();
string strDataXML = ..\\..\\XML\\InitData.xml;
//such as:Provider=CUBRIDProvider;Data Source=demodb;Location=localhost;User ID=dba;Password=;Port=5909
string strConn = dUtil.GetConnectString(strDataXML, 0);
string strChangeDb = testdb
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
conn.ChangeDatabase(strChangeDb);
{code}