Click here to Skip to main content
15,886,069 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
1.)I have tried
Here Equation is database
EquationDataset is dataset
BasicInfoTableAdapter is dataadapter
BasicInfo is table
VB
Private Sub BindingSource1_ListChanged(ByVal sender As System.Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Handles BindingSource1.ListChanged
'Checking for updation
        If EquationDataSet.HasChanges Then
            UpdatePending = True
        End If
    End Sub
Private Sub BasicDetailGrid_RowValidated(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles BasicDetailGrid.RowValidated
        If UpdatePending = True Then
            BasicInfoTableAdapter.Update(EquationDataSet.BasicInfo)
            UpdatePending = False
        End If
    End Sub

'I have read that ListChanged is fired before Rowvalidation for a while.

2.)I have also tried
VB
Private Sub BasicDetailGrid_RowLeave(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles BasicDetailGrid.RowLeave
        Try
            Me.Validate()
            Me.BindingSource1.EndEdit()
            Me.BasicInfoTableAdapter.Update(Me.EquationDataSet.BasicInfo)
            Me.EquationDataSet.AcceptChanges()
        Catch ex As Exception
            MsgBox("Update failed")
        End Try
    End Sub

'Please Help
Posted
Updated 13-Jun-11 0:14am
v2

1 solution

Hi

try this method( am using this and worked for me....)

VB
Dim manager As New EquationDataSetTableAdapters.TableAdapterManager

me.basicinfobindingsource.endedit()
me.bacicinfotableadapter.update(Me.EquationDataSet.BasicInfo)
manager.UpdateAll(EquationDataSet)
Me.BasicInfoTableAdapter.Fill(Me.EquationDataSet.BasicInfo)


Hope this works for u...
 
Share this answer
 
v5
Comments
Tarun.K.S 25-Aug-11 1:21am    
Ganesh, use the "code block" feature to wrap your code, looks better now.
Ganesan Natarajan 25-Aug-11 2:21am    
Thanks Buddy...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900