日期:2014-05-17 浏览次数:20945 次
string MyConnctionString="";
OleDbConnection MyConnection = new OleDbConnection(MyConnctionString);
public DataTable ExecReader_Sql(string strCmdText)
{
OleDbCommand oleDbCommand = new OleDbCommand();
oleDbCommand.CommandTimeout = 7200;
OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter();
DataTable dtRet = null;
try
{
oleDbCommand.Connection = MyConnection;
oleDbCommand.CommandText = strCmdText;
oleDbDataAdapter.SelectCommand = oleDbCommand;
if (MyConnection.State == ConnectionState.Closed)