Hey guys,
As you can see below I am trying to add row of data to a table called tblOut.
When i execute the code, it works without a single error message but the problem is I dont see any new record when i preview my table data.
Can anyone tell me what I did wrong
Thanks
Private Sub btnPrepare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrepare.Click
Dim shipCls As New WarehouseClassLibrary.ShippingClass
'Declare newOutRow as controller for tblOutRow
Dim newOutRow As GCR_ICDataSet1.tblOutRow
newOutRow = GCR_ICDataSet1.tblOut.NewtblOutRow()
'Creates an instance of user message box confirming user of completion
Dim result As MsgBoxResult = MessageBox.Show("Are you ready to add items to this order?", "Add Item", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
'Creates an instance of input error trap were the fields are checked to see if any null
If result = MsgBoxResult.Yes Then
If txtSalesOrder.Text = Nothing Or txtCarrier.Text = Nothing Or txtTracking.Text = Nothing Then
MessageBox.Show("Please complete required fields", "Incomplete Fields", MessageBoxButtons.OK, MessageBoxIcon.Stop)
Else
'Obtain new Control number
txtOutID.Text = shipCls.Get_ControlID()
'Create an instance of adding new items to the rows.
newOutRow.OutID = txtOutID.Text
newOutRow.OrderID = txtSalesOrder.Text
newOutRow.Carrier = txtCarrier.Text
newOutRow.Tracking = txtTracking.Text
newOutRow.ShipDate = Today()
GCR_ICDataSet1.tblOut.Rows.Add(newOutRow)
'Upon completion, Shipment info group box is disabled and add item group box is enabled.
gbShipInfo.Enabled = False
btnAdd.Enabled = True
gbItem.Enabled = True
txtModel.Focus()
End If
End If
End Sub