Yes, this exception is obvious. In
login_Authenticate
function, you are calling the same stored procedure "
AdminLogin
" and that procedure expects the parameters(
@Admin_Username and
@Admin_Password) which is not supplied. You need to pass both parameters as you are passing in
Login
function.
[Edit 1]
Try this code:
SqlCommand cmd = new SqlCommand("AdminLogin", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@Admin_Username", YourUserName);
cmd.Parameters.AddWithValue("@Admin_Password", YourPassword);
string CurrentName;
CurrentName = (string)cmd.ExecuteScalar();
--Amit