我要统计xuanze这张表里type id='1'的记录数一共多少条 把得到的结果赋值给int a
我写
int a=Convert.ToInt16("select count([tm id]) from xuanze where xuanze.[type id]='1'");
可是调试的结果是a为null 为什么count不出来呢
在查询分析器里我select count([tm id]) from xuanze where xuanze.[type id]='1' 这样执行这句可以计算出一共多少条记录 可是为什么在c#里那样打就是null了呢
我写
int a=Convert.ToInt16("select count([tm id]) from xuanze where xuanze.[type id]='1'");
可是调试的结果是a为null 为什么count不出来呢
在查询分析器里我select count([tm id]) from xuanze where xuanze.[type id]='1' 这样执行这句可以计算出一共多少条记录 可是为什么在c#里那样打就是null了呢
SqlDataAdapter comm=new SqlDataAdapter(sql,conn);
DataSet ds=new DataSet();
comm.Fill(ds,"xuanze");
string aaa=sql;我这样断点调试 aaa是null 我晕了
int count=ds.Tables["xuanze"].Rows.Count;