Hi I created this query which work 100% fine in vb.net light switch {See Code below} I wanting to add a where clause to say where GrnDetails.GrnNo.Id for the insert dunno how to add a where clause in please help
For Each GrnDetails As tblGrnDetail In tblGrnDetails
Dim Stockitem2 = New tblStockItem With _
{.BatchNo = GrnDetails.BatchNo, .qty = GrnDetails.Qty, .ProductId = GrnDetails.Product, _
.StoreCode = GrnDetails.StoreCode, _
.PackingingId = GrnDetails.PackagingId, _
.DateIn = Date.Today.ToString, _
.GrnNo = GrnDetails.GrnNo.Id, _
.Notes = "Detail Notes " & GrnDetails.Notes & " Header Notes " _
& GrnDetails.GrnNo.Notes}
GrnDetails.ExportedToStockItem = True
Next
For Each GrnDetails As tblGrnDetail In tblGrnDetails
GrnDetails.GrnNo.ExportToStockItem = True
Next
DataWorkspace.ApplicationData.SaveChanges()
ShowMessageBox("You have successfully Entered Stock onto the system.", "Stock Entered", MessageBoxOption.Ok)
Me.Refresh()
For Each GrnDetails As tblGrnDetail In tblGrnDetails
Dim Stockitem2 = New tblStockItem With _
{.BatchNo = GrnDetails.BatchNo, .qty = GrnDetails.Qty, .ProductId = GrnDetails.Product, _
.StoreCode = GrnDetails.StoreCode, _
.PackingingId = GrnDetails.PackagingId, _
.DateIn = Date.Today.ToString, _
.GrnNo = GrnDetails.GrnNo.Id, _
.Notes = "Detail Notes " & GrnDetails.Notes & " Header Notes " _
& GrnDetails.GrnNo.Notes}
GrnDetails.ExportedToStockItem = True
Next
For Each GrnDetails As tblGrnDetail In tblGrnDetails
GrnDetails.GrnNo.ExportToStockItem = True
Next
DataWorkspace.ApplicationData.SaveChanges()
ShowMessageBox("You have successfully Entered Stock onto the system.", "Stock Entered", MessageBoxOption.Ok)
Me.Refresh()