dinal
June 5th, 2006, 02:32 PM
hi friends,
if anybody can help me to validate user loging using SQL server stored procedure with ASP.net by C#..i created up to some extent..but ther's error in this part >>>>>
command.ExecuteNonQuery();
i= Convert.ToInt32(valid_customer.Value);
sss.Close();
----------------------------------------------------------------------------------------------
public int login_check(string F_username, string F_password)
{
try
{
DB_Connection db = new DB_Connection();
SqlConnection sss = db.openConnection();
SqlCommand command = new SqlCommand ("EXECUTE validatelog ?,? ,? output",sss);
if(sss.State .ToString ()=="Closed")
{
sss.Open() ;
}
else
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@username",SqlDbType.VarChar).Value=F_username;
command.Parameters.Add("@password",SqlDbType.VarChar).Value=F_password;
SqlParameter valid_customer= new SqlParameter("@numCust",SqlDbType.Int);
valid_customer.Direction=ParameterDirection.Output;
command.Parameters.Add(valid_customer);
command.ExecuteReader();
i= Convert.ToInt32(valid_customer.Value);
sss.Close();
}
}
catch(SqlException sdfd)
{
System.Console.WriteLine(sdfd);
}
return i;
}
if anybody can help me to validate user loging using SQL server stored procedure with ASP.net by C#..i created up to some extent..but ther's error in this part >>>>>
command.ExecuteNonQuery();
i= Convert.ToInt32(valid_customer.Value);
sss.Close();
----------------------------------------------------------------------------------------------
public int login_check(string F_username, string F_password)
{
try
{
DB_Connection db = new DB_Connection();
SqlConnection sss = db.openConnection();
SqlCommand command = new SqlCommand ("EXECUTE validatelog ?,? ,? output",sss);
if(sss.State .ToString ()=="Closed")
{
sss.Open() ;
}
else
{
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@username",SqlDbType.VarChar).Value=F_username;
command.Parameters.Add("@password",SqlDbType.VarChar).Value=F_password;
SqlParameter valid_customer= new SqlParameter("@numCust",SqlDbType.Int);
valid_customer.Direction=ParameterDirection.Output;
command.Parameters.Add(valid_customer);
command.ExecuteReader();
i= Convert.ToInt32(valid_customer.Value);
sss.Close();
}
}
catch(SqlException sdfd)
{
System.Console.WriteLine(sdfd);
}
return i;
}