Click here to Skip to main content
15,938,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application in VB .Net that connects to a database MS SQL. It is connected to a datagridview, the problem is when I add a new record when I update the dataset it accepts the 2 first cell values but the third cell becomes blank, if I click another row it exits rdit mode and accept all cell values if I press the update button.
here is the source
VB
Private Sub SaveToolStripButton_Click(sender As Object, e As EventArgs) Handles SaveToolStripButton.Click
      Me.Table1BindingSource.EndEdit()

      If DataSet11.HasChanges Then
          Try
              SqlDataAdapter1.Update(DataSet11, "Table_1")
              DataSet11.AcceptChanges()
          Catch eUpdate As System.Exception

              'Throw eUpdate
              MsgBox(eUpdate.Message.ToString)
          End Try
      End If
  End Sub

Ant ideas?

What I have tried:

I have tried this in first line
VB
Me.BindingContext(DataSet11, "Table_1").EndCurrentEdit()

but the same behavior seems that the code cannot stop the edit mode.
Posted

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