奇怪了,该查询表格是否存在的代码返回值总是-1? 返回
SqlSugar
老数据
3
2981
悬赏:5 飞吻
string sql = "select table_name from information_schema.tables where " +
"table_schema=@table_schema and table_name=@table_name";
int ans = db.Ado.ExecuteCommand(sql,new List<SugarParameter>() {
new SugarParameter("@table_schema",dbName),
new SugarParameter("@table_name",tbName)
});
return ans > 0 ? true : false;
我调试了很久,表确实在数据库中,但是查询结果总是返回-1,这是哪里出错了吗,各位大佬?
热忱回答(3)
-
fate stay night VIP0
2018/11/15ExecuteCommand是用来处理 增删改的
0 回复 -
hanshanton VIP0
2018/11/16搜嘎,尴尬了,有没有哪个类专门执行原生的SQL脚本啊?
0 回复 -
fate stay night VIP0
2018/11/20db.ado.sqlquery<string>(sql)
0 回复