We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GDBG supports dataset.merge?

Thread ID:

Created:

Updated:

Platform:

Replies:

25309 Feb 24,2005 02:25 AM Feb 24,2005 02:45 AM Windows Forms 1
loading
Tags: GridControl
Frank Lin
Asked On February 24, 2005 02:25 AM

I use dataset.merge to merge input changes to a GDBG datasource. GDBG will display duplicate records for modified rows. How can we update changes in GDBG to underlying database without retrieving? Private da As SqlDataAdapter Private ds As New DataSet() Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ... ds.Clear() da.Fill(ds, "dtCustomers") Me.GridDataBoundGrid1.DataSource = ds.Tables("dtCustomers") End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ''merging changes to GDBG''s datasource. ds.Merge(ds.GetChanges) End Sub

Administrator [Syncfusion]
Replied On February 24, 2005 02:45 AM

Hi Frank I think you haven''t defined a primary key on your DataTable in the DataSet. The grid only relects what''s inside the DataTable. The line ds.Merge(ds.GetChanges) is a unneccessary roundtrip. You merge your own rows back to the same place where they come from. If you do a GetChanges and updating against the database, then you''ll have to do a merge of this data. DataSet modifiedData = ds.GetChanges() da.Update( modifiedData ) Me.GridDataBoundGrid1.BeginUpdate() ds.Merge( modifiedData ) Me.GridDataBoundGrid1.EndUpdate() Me.GridDataBoundGrid1.Refresh() Regards, Thomas >I use dataset.merge to merge input changes to >a GDBG datasource. GDBG will display duplicate >records for modified rows. How can we update changes in GDBG to underlying database without retrieving? > > Private da As SqlDataAdapter > Private ds As New DataSet() > > Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load > ... > ds.Clear() > da.Fill(ds, "dtCustomers") > > Me.GridDataBoundGrid1.DataSource = ds.Tables("dtCustomers") > End Sub > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click >''merging changes to GDBG''s datasource. > ds.Merge(ds.GetChanges) > > End Sub

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;