TableAdapter DataType Mismatch errors ERROR [22018] RRS feed

  • Question

  • Hello all,

    I am attempting to add fields to a tableAdapter in a VS2005 C# / Crystal Reports Windows Form Application.  The Application itself has been running for 4 years at this time has has performed quite well ... until now !  The reports and DataSet are "data rich", and the App produces 14 different PDFs when completed.  The issue is that if I make a change ANY of the existing tableAdapter structures or Queries, I run the risk of of build failures.

    I have deleted the tableAdapters and rebuilt them, I have even tried building ONE tableAdapter, with TWO fields, one field to test the Insert, and the second to test an Update .. I cannot get the Insert to work as I continually get a "ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch." when calling the 'Fill' Insert Query.

    Once this error occurs, ANY and ALL queries that require a Parameter will Fail with the "ERROR [22018]" message ....

    Very frustrated at this point as it seems like the ODBC Driver and the .NET Framework Data Handler are not communicating as the failure does happen when the parameter is a 'Decimal' even  though the DBF field expected to receive the data is either a numeric(x,0), or an Integer ....


    I have counted fields vs. passed values (ALL 95!), checked all attributes, set EVERY Field to allow NULLS, have compared live data types with the expected field attributes...


    The Full error is below:

    System.Data.Odbc.OdbcException was unhandled
      Message="ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data type mismatch."
           at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
           at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod)
           at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader)
           at System.Data.Odbc.OdbcCommand.ExecuteNonQuery()
           at PDFWriter.TrackMasterDBDataSetTableAdapters.horse_outTableAdapter.InsertQueryHorseInfo(Decimal hn, String regno, String program, String pp, Nullable`1 race, String breed_type, String ppnew, String programnew, String horsename2, String oddsnew, String lasixchng, String mednew, String weight, String colorsexag, String jockname, String claimprc2, String breedname, String ownname, String equipnew, String lastsale, String thumbsup, String pwrrnktops, String avgclass, String clsrank, String avgspd, String spdrank, String pwrrating, String pwrrank, String epsrank, String comment1, String comment2, String comment3, Nullable`1 jn, Nullable`1 tn, Nullable`1 sn, Nullable`1 dn, String eqbkey, String ae_flag, String updwncls, String trainname, String sirename, String damname, String fourstar, String earnst, Nullable`1 ppcr, String sire1st, String sire2yo, String sireall, String siretrf, String jockl10, String jockl30, String jockds, String trainl30, String withjock, String trainds, String trn1st, String trn2yo, String trnclm, String trnlay, String trnup, String trndwn, String trnd2t, String trnt2d, String lifetime, String thisyear, String lastyear, String attrack, String turf, String wet, String atdist, String turfmud, String tylabel, String lylabel, String attrklabel, String wetlabel, String lifelabel, Nullable`1 attrksymb, String surface, String track, String race_date, String rbrdtype, Nullable`1 distance, String dist_unit, Nullable`1 todays_cls, String lifeearn, String tyearn, String tyearn1, String lyearn, String trkearn, String turfearn, String wetearn, String distearn, String mudearn, String hisr, Nullable`1 apprweight, String condstats) in C:\devel\PDFwriter\TrackMasterDBDataSet.Designer.cs:line 65513
           at PDFWriter.BuildHorseOut.InsertHorseNums() in C:\devel\PDFwriter\BuildHorseOut.cs:line 452
           at PDFWriter.BuildHorseOut.Build_Main(String inDate) in C:\devel\PDFwriter\BuildHorseOut.cs:line 77
           at PDFWriter.ThrMain.ThrMain_Load(Object sender, EventArgs e) in C:\devel\PDFwriter\ThrMain.cs:line 101
           at System.Windows.Forms.Form.OnLoad(EventArgs e)
           at System.Windows.Forms.Form.OnCreateControl()
           at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
           at System.Windows.Forms.Control.CreateControl()
           at System.Windows.Forms.Control.WmShowWindow(Message& m)
           at System.Windows.Forms.Control.WndProc(Message& m)
           at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
           at System.Windows.Forms.ContainerControl.WndProc(Message& m)
           at System.Windows.Forms.Form.WmShowWindow(Message& m)
           at System.Windows.Forms.Form.WndProc(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
           at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
           at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
           at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
           at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
           at System.Windows.Forms.Control.Show()
           at PDFWriter.ThrStart.RunPDFFiles(String[] args) in C:\devel\PDFwriter\ThrStart.cs:line 103
           at PDFWriter.Program.Main(String[] args) in C:\devel\PDFwriter\Program.cs:line 21
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()

    Tuesday, June 22, 2010 6:08 AM