In my Winforms application, I have a primary form with a DataGridView associated with a database Entity data source.
The mesh is set to not allow insertions. Instead, I have a button in my form that calls the second dialog in which the insert occurs (i.e. with a friendlier ui than is possible with a DataGridView).
The insert is working fine. Querying the base table in db indicates that the record has been inserted. However, I cannot get the DataGridView to see the new data created in the second dialog box in its primary form.
I read a lot of qaru q and a and tried various solutions to update the DataGridView to show new data .. but nothing works.
Should this be a normal situation? Can someone suggest some VB.NET code that will work?
Thanks,
Bazza
Dim qry = From o In mDB.tblFOMTestResults From p In mDB.tblProduct.DefaultIfEmpty _ From c In mDB.tblCalibration _ Where o.ProductID = p.ID And o.CalibrationID = c.ID _ Order By o.RunDate, p.ProductName Select _ o.ID, o.SampleCode, o.RunDate, o.ConditioningDays, o.ConditioningRHAndTemp, _ o.TestArea, o.EdgeSeal, o.SealedBags, o.FaceSeal, _ o.MoisturePercentage, o.CalibrationID, o.FYFOMH1, o.FYFOMH2, o.FYFOMH3, _ o.FYFOMH4, p.ProductName, o.ProductID Me.TblFOMTestResultsDataGridView.DataSource = qry
source share