Getchanges will not work with tabpages

T

Tupolev

Hi,

I have a strang problem with a form that have 5 tabpages and on each
page there is a datagrid. The problem: I can't get the getchanges work
(although on other forms it works fine) ! It seems that when I change from
tabpage, the datagrid does an accepthanges so there are no visible changes
made on the data. Sometimes however (when I change +- 3 times from tabpage)
it starts working. When someone know what is wrong, please respond.

Private allerleiadapter As Data.OleDb.OleDbDataAdapter
Private allerleidataset As New DataSet()

on formload:

sql = "Select * from Prijslijsten Where Prijslijsten.groep = 'allerlei'"

allerleiadapter = New OleDb.OleDbDataAdapter(sql, connection1)

allerleiadapter.Fill(allerleidataset, "allerlei")

DGallerlei.DataSource = allerleidataset

DGallerlei.DataMember = "allerlei"

allerlei.MappingName = "allerlei"

than in a private sub:

Dim deletedrows As New DataTable()

Dim updatedrows As New DataTable()

deletedrows = dataset1.Tables(0).GetChanges(DataRowState.Deleted)

updatedrows = dataset1.Tables(0).GetChanges(DataRowState.Modified)



Tupolev
 
O

One Handed Man

You could update when you change data in a cell, that way your data will
remain current.


--
Regards - One Handed Man

Author : Fish .NET & Keep .NET

==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top