當我試圖執行它顯示上述錯誤的代碼時。已經是一個開放的DataReader與這個命令相關聯,必須先關閉
try
{
com.CommandText = "select * from Export";
com.ExecuteReader();
data_mode = "Export";
com.CommandText = "Insert INTO [" + New_access_file + "]." + data_mode + " select * FROM ExportDATA";
com.ExecuteNonQuery();
}
catch
{
data_mode = "Export";
com.CommandText = "SELECT * INTO [" + New_access_file + "]." + data_mode + " FROM ExportDATA";
com.ExecuteReader();
}
感謝它工作完美。 – SoumitaP 2013-04-23 07:34:46