Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 25, 2007 07:53 PM by prashant0268
Sep 25, 2007 03:26 PM|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 03:48 PM|LINK
What is the definition for this.Inspection_DispositionsTableAdapter.InsertInspection_Disposition? And what parameter types does it expect?
Sep 25, 2007 05:45 PM|LINK
Sep 25, 2007 05:48 PM|LINK
Did you step in to the InsertInspection_Dispisution method. I suspect the error is happening there.
Sep 25, 2007 05:59 PM|LINK
Try using as below:
int iDispositionID this.Inspection_DispositionsTableAdapter.InsertInspection_Disposition(iDisposition, iInspectionID) ?? default(int);
Sep 25, 2007 06:00 PM|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 06:03 PM|LINK
Hemant, I tried using the solution but it is still not working..
Sep 25, 2007 06:07 PM|LINK
I hope, you web site is pointing to framework 2.0 in IIS as Nullable Types are introduced in 2.0 :)
The error is happening at that location and it is occuring before I can step into that procedure.
Sep 25, 2007 06:38 PM|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.