Prroblem with Parameters.
int xyz;
cmd.CommandType =CommandType.StoredProcedure ;
cmd.CommandText ="usercheck";
SqlParameter p1=new SqlParameter ("@uname",System.Data .SqlDbType .VarChar ,2);
p1.Direction =ParameterDirection.Input ;
SqlParameter p2=new SqlParameter ("@pasword",System.Data .SqlDbType .VarChar ,2);
p2.Direction =ParameterDirection.Input ;
SqlParameter p3=new SqlParameter ("@res",System.Data .SqlDbType .Int ,4);
p2.Direction =ParameterDirection.Output ;
cmd.Parameters .Add(p1);
cmd.Parameters .Add (p2);
cmd.Parameters .Add (p3);
xyz=cmd.ExecuteNonQuery ();
if (xyz>0)
Server.Transfer ("Form1.aspx");
else
Server.Transfer ("loginpage.aspx");
i got this error whuy pls
Procedure 'usercheck' expects parameter '@uname', which was not supplied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Procedure 'usercheck' expects parameter '@uname', which was not supplied.
Source Error:
Line 80: cmd.Parameters .Add (p3);
Line 81:
Line 82: xyz=cmd.ExecuteNonQuery ();
Line 83: if (xyz>0)
Line 84: Server.Transfer ("Form1.aspx");
Source File: c:\inetpub\wwwroot\passingvaluesforms\loginpage.as px.cs Line: 82
|