用string型进行比较
你查询数据库的时候返回dataSet
然后dataSet.table[0].row[0][0].tostring();//数据库的值
然后你用来比较的值得用string 定义一下来进行比较就行了
ExecuteNonQuery 是执行更新 或者插入数据库中用的比较多!!
我一般是SqlDataAdapter DataTable 验证!!
string strSql="select count(*) as c from UserID_Main where UserID='"+ this.CboUserN.Text.Trim() +"' and Password='"+ pwd +"'"
DataTable 判断行数,0就不正确,>0就是正确的