M
Mike McCarthy
When I execute the following code I get the error..
Stored procedure get_nextid expects parameter @next_id which was not
supplied
What am I doing wrong
public String GetNewKey()
{
String myid = "";
OdbcConnection myConnection = new
OdbcConnection("DSN=RMS5SQL_DSN;UID=FireRMS5_USER;PWD=98953");
myConnection.Open();
OdbcCommand myCommand = new OdbcCommand("get_nextid", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
OdbcParameter workParam = null;
workParam = myCommand.Parameters.Add("@next_id", OdbcType.Int);
workParam.Direction = ParameterDirection.Output;
myCommand.ExecuteNonQuery();
myid = myCommand.Parameters["@next_id"].Value.ToString();
//pad with "_000" to 14 length (Typical key in FireRMS)
myid = myid.PadLeft(14,'0');
return myid;
}
Stored procedure get_nextid expects parameter @next_id which was not
supplied
What am I doing wrong
public String GetNewKey()
{
String myid = "";
OdbcConnection myConnection = new
OdbcConnection("DSN=RMS5SQL_DSN;UID=FireRMS5_USER;PWD=98953");
myConnection.Open();
OdbcCommand myCommand = new OdbcCommand("get_nextid", myConnection);
myCommand.CommandType = CommandType.StoredProcedure;
OdbcParameter workParam = null;
workParam = myCommand.Parameters.Add("@next_id", OdbcType.Int);
workParam.Direction = ParameterDirection.Output;
myCommand.ExecuteNonQuery();
myid = myCommand.Parameters["@next_id"].Value.ToString();
//pad with "_000" to 14 length (Typical key in FireRMS)
myid = myid.PadLeft(14,'0');
return myid;
}