January 16, 2005 at 1:35 pm
hi i hava a stored procedure which accepts some parameters...
previousy i was working with sqlconnection in asp.net to call this storeprocedure.......every thing was working fine
but now when i started to use an odbc connection, when ever i call that stored procedure it give me following error msg... Although i have provided all the parameters it recuires........code is also given below...... plz help soon
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.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'login' expects parameter '@loginid', which was not supplied.
Source Error:
|
Source File: f:\onlineresume\onlineresume\jps\users.cs Line: 31
Stack Trace:
code to call is
OdbcCommand sqlcom=
new OdbcCommand("login",sqlcon);
sqlcom.CommandType=CommandType.StoredProcedure;
sqlcom.Parameters.Add("@loginid",OdbcType.VarChar);
sqlcom.Parameters["@loginid"].Value=id;
sqlcom.Parameters.Add("@password",OdbcType.VarChar);
sqlcom.Parameters["@password"].Value=password;
sqlcom.Parameters.Add("@loginstatus", OdbcType.Int);
sqlcom.Parameters["@loginstatus"].Direction = ParameterDirection.Output;
sqlcon.Open();
sqlcom.ExecuteNonQuery();
int count=Convert.ToInt32(sqlcom.Parameters["@loginstatus"].Value);
January 17, 2005 at 2:33 pm
Check whether you have initialized the variable "id".
As the visual studio environment has a rich facility for debugging. check the variable you are assigning
is not null and so on.
Thanks,
Ganesh
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply