运行查询时出现此错误:
解析查询时出错。 [令牌行号= 1,令牌行偏移= 157,令牌错误=选择]
这正是我在使用2008 R2时编写内容时所使用的...
以下是查询:
INSERT INTO tblExample([Example], [GroupID], [Key], [Value], [ExpectedColumn])
VALUES (@Example, @GroupID, @k, @v, @ExpectedColumn);
SELECT @@IDENTITY;
执行:
if (db == null) { throw new Exception("You must give me an actiavted DBCon!"); }
object ret = null;
db.Command.CommandText = query;
AddParameters(db.Command, parameters);
if (db.Connection.State != ConnectionState.Open)
db.Connection.Open();
var temp = db.Command.ExecuteScalar();
if (temp != null && temp != DBNull.Value)
{
ret = temp;
}
return ret;