日期:2014-05-17 浏览次数:20752 次
//这句执行不通过,不懂的地方在F1这个字段处应该改为什么?我将‘F1’改为 ‘*’试过,语句通不过
//这条语句其实表达的意思是:除前面2条记录外的所有的其他记录被选择
"SELECT * FROM [" + table + "] WHERE F1 NOT IN (SELECT TOP 2 F1 FROM [" + table + "])";
//////////////////////////////////////////////////////////////////////////////
//下面代码大约一看,有疑问的地方,我单独注视了
//////////////////////////////////////////////////////////////////////////////
string strCom = " SELECT * FROM [" + table + "] ";
string strTab="["+table +"]";
//string strCom = "SELECT * FROM [" + table + "] WHERE F1 NOT IN (SELECT TOP 2 F1 FROM [" + table + "])";
//string strCom = "SELECT TOP 5 * FROM [" + table + "]";
DataSet ds;
ds = new DataSet();
OleDbCommand myComd;
OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom, g_SouceConn);
//myCommand.DeleteCommand = new OleDbDataAdapter("DELETE TOP (5) FROM " + strTab, ts).DeleteCommand;
myCommand.DeleteCommand = new OleDbCommand("DELETE * FROM " + strTab, g_SouceConn);
try