starazam

starazam

  • NA
  • 43
  • 0

stored procedure parameter problem

Jan 16 2005 3: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 Server Error in '/OnlineResume' Application. -------------------------------------------------------------------------------- ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'login' expects parameter '@loginid', 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.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'login' expects parameter '@loginid', which was not supplied. Source Error: Line 29: sqlcom.Parameters["@loginstatus"].Direction = ParameterDirection.Output;Line 30: sqlcon.Open();Line 31: sqlcom.ExecuteNonQuery();Line 32: int count=Convert.ToInt32(sqlcom.Parameters["@loginstatus"].Value);Line 33: sqlcon.Close(); 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);