我正在使用 Visual Studio 2008 用 C# 编写程序,从.sdf
文件中检索数据时出错
解析查询时出错
SqlCeConnection
我的代码是
SqlCeConnection conn = new SqlCeConnection(connStr);
SqlCeCommand cmd = new SqlCeCommand();
DataSet ds = new DataSet();
SqlCeDataAdapter da;
try
{
conn.Open();
cmd = conn.CreateCommand();
if(mode == "update")
cmd.CommandText = "SELECT eq_id, description, bl_id, fl_id, rm_id, modelno, category, eq_std, comments FROM eq where (isModified = 1) SELECT * FROM eq_log";
else if(mode == "create")
cmd.CommandText = "SELECT eq_id, description, bl_id, fl_id, rm_id, modelno, category, eq_std, comments FROM eq where (isModified = 2) SELECT * FROM eq_log";
da = new SqlCeDataAdapter(cmd);
da.Fill(ds);
return ds;
}
catch (Exception db)
{
}
错误是:
解析查询时出错。[令牌行号 = 2,令牌行偏移量 = 1,错误中的令牌 = SELECT]
异常详细信息:System.Data.SqlServerCe.SqlCeException:解析查询时出错。解析查询时出错。[ 令牌行号 = 2,令牌行偏移量 = 1,错误令牌 = SELECT