奇怪了,该查询表格是否存在的代码返回值总是-1? 返回

SqlSugar 老数据
3 2981

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)