Last post Sep 25, 2007 08:53 PM by prashant0268
Sep 25, 2007 04:26 PM|prashant0268|LINK
I am getting this error at runtime (Specified cast is not valid.) even when the 2 parameters are int and their values are way less than infinity.. ( they are 1002 and 25).
The return type is a nullable int (int?)
Sep 25, 2007 04:48 PM|ps2goat|LINK
What is the definition for this.Inspection_DispositionsTableAdapter.InsertInspection_Disposition? And what parameter types does it expect?
Sep 25, 2007 06:45 PM|prashant0268|LINK
Sep 25, 2007 06:48 PM|jguadagno|LINK
Did you step in to the InsertInspection_Dispisution method. I suspect the error is happening there.
Sep 25, 2007 06:59 PM|hemantpurkar|LINK
Try using as below:
int iDispositionID this.Inspection_DispositionsTableAdapter.InsertInspection_Disposition(iDisposition, iInspectionID) ?? default(int);
Sep 25, 2007 07:00 PM|hemantpurkar|LINK
Sorry for syntax error on above post, I mean as below:
int iDispositionID = this.Inspection_DispositionsTableAdapter.InsertInspection_Disposition(iDisposition, iInspectionID) ?? default(int);
Sep 25, 2007 07:03 PM|prashant0268|LINK
Hemant, I tried using the solution but it is still not working..
Sep 25, 2007 07:07 PM|hemantpurkar|LINK
I hope, you web site is pointing to framework 2.0 in IIS as Nullable Types are introduced in 2.0 :)
Sep 25, 2007 07:07 PM|prashant0268|LINK
The error is happening at that location and it is occuring before I can step into that procedure.
Sep 25, 2007 07:38 PM|ps2goat|LINK
Was the table adapter created with a wizard? Open the wizard back up and view the SQL code or the stored procedure, as the SQL is most likely where your code is bombing. You can't step into that with the debugger.
Sep 25, 2007 08:53 PM|prashant0268|LINK
The problem was solved..
Even though, changing the property has served as a solution, I am not sure why it was giving that particular error.