Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

oledb exception too many fields defined while updating MS Access database in my wpf app vb.net

$
0
0

I try hard to understand why, but nothing

I have a table with 132 fields (but I think, that's not the probleme). I built a User Control that contains textBox, Combobox, ... to save their content in the database,

So when I save it as a new record in the database, It work perfectecly.

But when I want to save it, as an existing record, (that is to update an existing record) VS fired me with this error

System.Data.OleDb.OleDbException was unhandled
  ErrorCode=-2147467259
  HResult=-2147467259
  Message=too many fields defined.
  Source=Microsoft Office Access Database Engine

HERE IS the Code

Dim SNIGDoFFEDataSet As SNIGDoFFE.SNIGDoFFEDataSet = CType(Me.FindResource("SNIGDoFFEDataSet"), SNIGDoFFE.SNIGDoFFEDataSet) Dim SNIGDoFFEDataSetCasCoderTableAdapter As SNIGDoFFE.SNIGDoFFEDataSetTableAdapters.CasCoderTableAdapter = New SNIGDoFFE.SNIGDoFFEDataSetTableAdapters.CasCoderTableAdapter() Dim newCasCoderRow As SNIGDoFFEDataSet.CasCoderRow ' = SNIGDoFFEDataSet.CasCoder.NewCasCoderRow() Dim newCasCoderTable As SNIGDoFFEDataSet.CasCoderDataTable newCasCoderTable = SNIGDoFFEDataSetCasCoderTableAdapter.GetData If MainWindow.modeModification Then

'if in editing mode, get the specific row newCasCoderRow = newCasCoderTable.FindByid(MainWindow.idDuCas) Else 'else get new row newCasCoderRow = SNIGDoFFEDataSet.CasCoder.NewCasCoderRow() End If 'begin input data into the table newCasCoderRow.id = IdCas.Text newCasCoderRow.CentreCollecte = cboCentreCollecte.Text newCasCoderRow.Thematique = cboThematique.Text 'etc, etc, etc 'if new row, I add it like expected If Not MainWindow.modeModification Then SNIGDoFFEDataSet.CasCoder.Rows.Add(newCasCoderRow) End If 'the exception is throw on this line

SNIGDoFFEDataSetCasCoderTableAdapter.Update(newCasCoderRow)

Help me understand why and what to please



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>