无法从int隐转换到System.Data.SqlClient....
public Model.user.web_userinfo Login(string _username, string _password, string _ip)
{
int rowsAffected;
SqlParameter[] parameters = {
new SqlParameter( "@Username ",SqlDbType.VarChar,30),
new SqlParameter( "@Password ",SqlDbType.VarChar,32),
new SqlParameter( "@IP ",SqlDbType.VarChar,15),
};
parameters[0].Value = _username;
parameters[1].Value = _password;
parameters[2].Value = _ip;
SqlDataReader rdr = DbHelperSQL.RunProcedure( "web_userinfo_login ", parameters, out rowsAffected);
if(rdr.Read())
{
Model.user.web_userinfo myInfo = new LHF.Model.user.web_userinfo();
myInfo.userid = Convert.ToInt32(rdr[ "userid "]);
myInfo.Ltype = Convert.ToInt32(rdr[ "Ltype "]);
myInfo.Nickname = rdr[ "Nickname "].ToString();
myInfo.State = Convert.ToInt32(rdr[ "State "]);
return myInfo;
}
}
上面一句SqlDataReader rdr = DbHelperSQL.RunProcedure( "web_userinfo_login ", parameters, out rowsAffected);错误,谁好心帮我看下好行。谢谢了。。。
------解决方案--------------------是什么错误?
------解决方案--------------------DbHelperSQL.RunProcedure 返回值啥类型
------解决方案--------------------SqlDataReader用完后应关闭,不知是否有关?