i just got started with ASP.Net, i only knew PHP so which means im a little stubborn. i need real examples.
heres my problem, i got this class in a class library called Class1
, it connects to the database and ask for verification of user login.
public string userlogin(string loginuser,string loginpass)
{
string type = null;
myCon.Open();
SqlCommand logincheck = new SqlCommand("CheckID", myCon);
logincheck.CommandType = CommandType.StoredProcedure;
logincheck.Parameters.Add("@userid", SqlDbType.NVarChar).Value = loginuser;
logincheck.Parameters.Add("@password", SqlDbType.NVarChar).Value = loginpass;
SqlDataReader dr;
dr = logincheck.ExecuteReader();
while (dr.Read())
{
type = //here i want to get the value of type in my database
break;
}
myCon.Close();
return type;
}
here's my stored procedure
ALTER PROCEDURE dbo.logincheck
@userid nchar(10),
@password nchar(20)
AS
Select * from users Where userid = @userid and password = @password
RETURN
i need a set of examples please.