I\'m trying to get the Score_Waarde
value from my database using the following code :
critid = critid_arr[teller2].ToString();
int scorehulp =
I was originally getting this error (my C# code
someobject.TotalItemCount = (Int32)dbManager.GetParameterValue("TotalRows"))
where TotalItemCount
was of int
type, even though the SP was fine & was giving proper result. I got rid of this just by fixing the SP by adding the following code
Set @TotalRows = @@rowcount.
Your SQL is probably giving back a different numeric type, such as long
or decimal
, or, apparently, string
.
Call Convert.ToInt32
, which doesn't have the limitations of an unboxing cast.