A
Andrew
Hi all
I'm having a problem in my continued experimentations with ADO .Net
and Windows forms.
I've been playing with the Northwind Database on SQL 2005, and with
creating data-bound forms.
I have a form, with a DataGridView called Order_DetailsDataGridView
which was created by dragging and dropping the related table in the
Orders table in the data sources window.
Everything works well until I try to detect and save changes. No
errors, but nothing happens!! When I reload the form, the data is
unchanged.
Here's the code - if anyone can help, I'd be grateful.
Regards
Andrew
Private Sub Order_DetailsDataGridView_CellValueChanged _
(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
Handles Order_DetailsDataGridView.CellValueChanged
Order_DetailsDataGridView.EndEdit()
If Me.NorthwindDataSet.HasChanges Then
Select Case MessageBox.Show("Are you sure you wish to
change this value?", _
"Confirm change", MessageBoxButtons.YesNo)
Case Windows.Forms.DialogResult.Yes
Me.Order_DetailsTableAdapter.Update
(Me.NorthwindDataSet)
End Select
End If
End Sub
I'm having a problem in my continued experimentations with ADO .Net
and Windows forms.
I've been playing with the Northwind Database on SQL 2005, and with
creating data-bound forms.
I have a form, with a DataGridView called Order_DetailsDataGridView
which was created by dragging and dropping the related table in the
Orders table in the data sources window.
Everything works well until I try to detect and save changes. No
errors, but nothing happens!! When I reload the form, the data is
unchanged.
Here's the code - if anyone can help, I'd be grateful.
Regards
Andrew
Private Sub Order_DetailsDataGridView_CellValueChanged _
(ByVal sender As Object, _
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
Handles Order_DetailsDataGridView.CellValueChanged
Order_DetailsDataGridView.EndEdit()
If Me.NorthwindDataSet.HasChanges Then
Select Case MessageBox.Show("Are you sure you wish to
change this value?", _
"Confirm change", MessageBoxButtons.YesNo)
Case Windows.Forms.DialogResult.Yes
Me.Order_DetailsTableAdapter.Update
(Me.NorthwindDataSet)
End Select
End If
End Sub