J
Jim Heavey
Hello, I am transitioning from VB to C# and I can't tell if my problem is
to do with the format of my command or something else.
I am getting an error of "Object reference not set to an instance of the
object" when it hits this line of code..
int rtnValue = (int) cmd.Parameters["@RETURN_VALUE"].Value;
I set my Parameter up as follows:
cmd.Parameters.Add("@RETURN_VALUE",SqlDbType.Int).Direction =
ParameterDirection.ReturnValue ;
I used a "foreach" to loop through each of my parms, with the @RETURN_VALUE
being the last one. Each time this loop generates the same error when it
gets to the "@RETURN_VALUE". I do not see anything wrong with how I have
set it up. Does the procedure that I am executing "HAVE TO" use the
"return statement in order to properly populate the parm?
Any ideas?
Thanks inadvance for your assistance!!!!!!!!!
to do with the format of my command or something else.
I am getting an error of "Object reference not set to an instance of the
object" when it hits this line of code..
int rtnValue = (int) cmd.Parameters["@RETURN_VALUE"].Value;
I set my Parameter up as follows:
cmd.Parameters.Add("@RETURN_VALUE",SqlDbType.Int).Direction =
ParameterDirection.ReturnValue ;
I used a "foreach" to loop through each of my parms, with the @RETURN_VALUE
being the last one. Each time this loop generates the same error when it
gets to the "@RETURN_VALUE". I do not see anything wrong with how I have
set it up. Does the procedure that I am executing "HAVE TO" use the
"return statement in order to properly populate the parm?
Any ideas?
Thanks inadvance for your assistance!!!!!!!!!