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

Locate and edit row in Acces Database Table throws "Object Reference not set to an instance of object"

$
0
0

I save data in an Access Database table named TraiteTravail, with it primary key field namedid and want to edit a specific row, but I get this:

"""An unhandled exception of type 'System.NullReferenceException' occurred in SNIGDoFFE.exe

Additional information: Object reference not set to an instance of an object."""

but When I look in my database, the row with the id specified, exits in the table"TraiteTravail"

Dim SNIGDoFFEDataSet As SNIGDoFFE.SNIGDoFFEDataSet = CType(Me.FindResource("SNIGDoFFEDataSet"), SNIGDoFFE.SNIGDoFFEDataSet) Dim SNIGDoFFEDataSetTraiteTravailTableAdapter As SNIGDoFFE.SNIGDoFFEDataSetTableAdapters.TraiteTravailTableAdapter = New SNIGDoFFE.SNIGDoFFEDataSetTableAdapters.TraiteTravailTableAdapter() Dim TraiteTravailRow As SNIGDoFFEDataSet.TraiteTravailRow = SNIGDoFFEDataSet.TraiteTravail.FindByid(MainWindow.IdCas) 'edit some fields TraiteTravailRow.T1_DateIdentification = t1.Text TraiteTravailRow.T2_MoisSeparation = t2.Text TraiteTravailRow.T2_AnneeSeparation = t2_.Text

'to update the table with the new added data, I suppose

SNIGDoFFEDataSetTraiteTravailTableAdapter.Update(TraiteTravailRow)

so I'm wondering what I've done wrong, why the FindByid, not work here,

Please, help me.


Viewing all articles
Browse latest Browse all 18858

Trending Articles