string strSql = "select count(*) from rsm_frame where roomid= 'a1 ' ";
我想获得执行这条SQL语句的返回值,请问应该用什么函数?
------解决方案--------------------------------------------------------
ExecuteScalar
------解决方案--------------------------------------------------------
SqlCommand com=new SqlCommand( "select count(*) from rsm_frame where roomid= 'a1 ' ",con);
con.open()
int count=(int)com.ExecuteScalar();
con.close();