日期:2014-05-18 浏览次数:20828 次
SqlParameter[] parameters = {new SqlParameter("@name", SqlDbType.VarChar,40), new SqlParameter("@password", SqlDbType.VarChar,100)}; parameters[0].Value = "";//赋值@NAME parameters[1].Value = "";//赋值@PASSWORD SqlCommand cmd = new SqlCommand(); //后边执行的语句不写了。。。累
------解决方案--------------------
public int existJud(string uname, string upassword)
{
SqlConnection cn=new SqlConnection("连接字符串");
SqlCommand cmd=new SqlCommand(SQL_SELECT_USER,cn);
cmd.Parameters.AddWithValue("@name",uname);
cmd.Parameters.AddWithValue("@password",upassword);
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
}