ServerVersion异常,无效操作。连接被关闭。
////////////////////////////////////////////////
private DataSet ExecuteSQL4DS(string strSQL)
{
try
{
OleDbDataAdapter currentDA = new OleDbDataAdapter(strSQL, oleDbConnection1);
DataSet ds = new DataSet("ds");
currentDA.Fill(ds);
return ds;
}
catch (OleDbException ex)
{
return null;
}
}
////////////////////////////////////////////////
oleDbConnection1断点跟踪出现的异常。
----ServerVersion “oleDbConnection1.ServerVersion”引发了“System.InvalidOperationException”类型的异常 string {System.InvalidOperationException}
----base {"无效操作。连接被关闭。"} System.Exception {System.InvalidOperationException}
----StackTrace " 在 System.Data.ProviderBase.DbConnectionClosed.get_ServerVersion()\r\n 在 System.Data.OleDb.OleDbConnection.get_ServerVersion()" string
////////////////////////////////////////////////
在我的2003系统的机子调试,虽然有异常,但是不会出错。还是能执行下去return ds。再另外一台2003系统的机器,却卡在这里不能执行了。catch到异常返回null。