求助~~
public SqlDataReadergetuserlogin(String suserid,String suserpwd)
{
SqlConnection conn=new SqlConnection(ConfigurationSettings.AppSettings["sqlconnectionstring"]);
SqlCommand cmd=new SqlCommand("pr_getuserlogin",conn);
//定义访问数据库的方式为存储过程
cmd.CommandType=CommandType.StoredProcedure;
//创建访问数据库的参数
SqlParameter puserid=new SqlParameter("@userid",SqlDbType.VarChar);
puserid.Value=suserid;
cmd.Parameters.Add(puserid);
SqlParameter puserpwd=new SqlParameter("@userpwd",SqlDbType.VarChar);
puserpwd.Value=suserpwd;
cmd.Parameters.Add(puserpwd);
SqlDataReader dr=null;//定义数据读取器
try
{
conn.Open();
}
catch(Exception ex)
{
throw new myexception("10001","数据库连接失败",ex);
}
try
{
//执行数据库的存储过程(访问数据库)
dr=cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch(Exception ex)
{
throw new myexception("10002",ex.Message,ex);
}
return dr;
}
说SqlDataReadergetuserlogin这里类、结构或接口方法必须有返回类型,什么意思呢,应该怎么改呢