TableAdapter, BindingSource and DataSet - the first record.

  • Thread starter Thread starter Hubert Wisniewski
  • Start date Start date
H

Hubert Wisniewski

Hi,

I have a problem with first record in my table. I put the data to the
table and it's ok, but if I add second row to the table the
first record is updated (and has the same value as the second row). I
use the same code for three tables in my application and it works
without any problem with this one exception. If I have the first item
the another I can add without any problem.


[
Dim drRows As DataRowCollection
Dim objNewRow As DataRow
drRows = VenusDataSet.pdmsap.Rows
objNewRow = VenusDataSet.pdmsap.NewRow()

objNewRow("dok") = RefTextBox.Text
drRows.Add(objNewRow)

Me.PdmsapBindingSource.EndEdit()
Me.PdmsapTableAdapter.Update(Me.VenusDataSet.pdmsap)
]

BR
Hubert
 
"If I have the first item the another I can add without any problem."
Wanna try that again - I have no idea what you are saying here. It sounds
like you are using the same 'reference' for both the first and second record,
but since you only show the code for adding 1 record, it is hard to say.
 
Back
Top