I'm doing a masterdetail form, so far when you typed the data in the detailed form and datagridview, it works, but the moment you save it and load it again nothing appears in the datagridview, but the one in the detailed form works properly
here is the code I used:
here is the code I used:
VB.NET:
Private Sub ProductsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductsBindingNavigatorSaveItem.Click
If Validate() Then
ProductsBindingSource.EndEdit()
OrderIDBindingSource.EndEdit()
Try
Me.OrderIDTableAdapter.Update(Me.Database1DataSet.OrderID.Select("", "", DataViewRowState.Deleted))
ProductsTableAdapter.Update(Me.Database1DataSet.Products.Select("", "", DataViewRowState.Added Or _
DataViewRowState.ModifiedCurrent Or DataViewRowState.Deleted))
Me.OrderIDTableAdapter.Update(Me.Database1DataSet.Products.Select("", "", DataViewRowState.Added Or _
DataViewRowState.ModifiedCurrent Or DataViewRowState.Deleted))
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End Sub
Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Database1DataSet.OrderID' table. You can move, or remove it, as needed.
Me.OrderIDTableAdapter.Fill(Me.Database1DataSet.OrderID)
'TODO: This line of code loads data into the 'Database1DataSet.Products' table. You can move, or remove it, as needed.
Me.ProductsTableAdapter.Fill(Me.Database1DataSet.Products)
End Sub