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.

DBDG--Making grid match back-end database

Thread ID:

Created:

Updated:

Platform:

Replies:

34680 Sep 14,2005 09:34 AM Sep 15,2005 04:46 AM Windows Forms 3
loading
Tags: GridControl
dan carr
Asked On September 14, 2005 09:34 AM

I set up a DBDG using the wizard--i.e. create dataadapter, create dataset, base DBDG on dataset When a user enters dup information or something else NOT allowed by the database I catch the error (Try..Catch block--see below) but the DBDG is not updated to display this. i.e. If ''Name'' must be unique (in database) and user enters ''John'' 50X in the grid it will appear only once in the database but 50X in the grid. Same thing applies to deleting records which are/have foreign keys: won''t be deleted from DB but will be deleted from DBDG. Not sure if I should refresh the DBDG or actively delete/add the current cell Try Me.adpGroup.Update(Me.dtsGroup1.sct_Group) Catch ex As Exception errorMessage = ex.Message.ToString() errorMessage = "Group " + CStr(Me.grdGroup(rowIndex, 1).CellValue) + " NOT UPDATED. " + errorMessage ''SOMETHING MUST BE DONE HERE Finally Me.stpErrors.Text = eventDisplay + errorMessage End Try

Administrator [Syncfusion]
Replied On September 14, 2005 10:59 AM

After, getting the error, try calling Refresh on the CurrencyManager to see if this will handle this problem. CurrencyManager cm = me.grid.BindingContext(me.grid.DataSource, me.grid.DataMember) cm.Refresh()

dan carr
Replied On September 14, 2005 11:55 AM

Did not work. Record still appears (even though not inserted in DB) Added: Dim cm As CurrencyManager = Me.grdGroup.Binder.BindingContext(Me.grdGroup.DataSource, Me.grdGroup.DataMember) cm.Refresh() Thanks, Dan

Administrator [Syncfusion]
Replied On September 15, 2005 04:46 AM

Hi Dan, Your Direct Trac incident id 20955 is updated. Regards, Stanley

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.

;