If InvoiceNumberTextBox.Text <> "" And ClientNoTextBox.Text <> "" And FirstNameTextBox.Text <> "" And LastNameTextBox.Text <> "" And ProductNameTextBox.Text <> "" And ProductCodeTextBox.Text <> "" And ProductUnitTextBox.Text <> "" And QuantityTextBox.Text <> "" And ProductPriceTextBox.Text <> "" And TotalPriceTextBox.Text <> "" And Label1.Text <> "" And DateToDeliverDateTimePicker.Text <> "" And AddressTextBox.Text <> "" And ContactNoTextBox.Text <> "" Then
Dim DT As String
DT = Label1.Text
cmdinsert.CommandText = "INSERT INTO Orders ([InvoiceNumber], [ClientNo], [FirstName], [LastName], [ProductName], [ProductCode], [Unit], [Quantity], [Price], [TotalPrice], [DateToday], [DateToDeliver], [Address], [ContactNo]) VALUES ('" & InvoiceNumberTextBox.Text & "', '" & ClientNoTextBox.Text & "', '" & FirstNameTextBox.Text & "', '" & LastNameTextBox.Text & "', '" & ProductNameTextBox.Text & "', '" & ProductCodeTextBox.Text & "', '" & ProductUnitTextBox.Text & "', '" & QuantityTextBox.Text & "', '" & ProductPriceTextBox.Text & "', '" & TotalPriceTextBox.Text & "', '" & Label1.Text & "', '" & DateToDeliverDateTimePicker.Text & "', '" & AddressTextBox.Text & "', '" & ContactNoTextBox.Text & "')"
cmdinsert.CommandType = CommandType.Text
cmdinsert.Connection = cnn
cmdinsert.ExecuteNonQuery()
MsgBox("Added")
ProductNameTextBox.Clear()
ProductPriceTextBox.Clear()
FirstNameTextBox.Clear()
ContactNoTextBox.Clear()
TotalPriceTextBox.Clear()
ProductUnitTextBox.Clear()
LastNameTextBox.Clear()
AddressTextBox.Clear()
ClientNoTextBox.Clear()
ProductCodeTextBox.Clear()
QuantityTextBox.Clear()
InvoiceNumberTextBox.Clear()
If QuantityTextBox.Text <> "" Then
cmdupdate.CommandText = "update Products set Quantity = '" & Label4.Text & "' where ProductCode = '" & ProductCodeTextBox.Text & "'"
cmdupdate.CommandType = CommandType.Text
cmd.Connection = cnn
cmdupdate.ExecuteNonQuery()
Else
MsgBox("PLEASE CHECK YOUR FORM")
End If
cmdupdate.Dispose()
Me.ProductsTableAdapter.Fill(Me.DatabaseCasanovaDataSet.Products)
ProductsDataGridView.Refresh()
ProductsDataGridView.Update()
End If
cmdinsert.Dispose()
Debug say is Mismatch expression but i check 3x on my database order by in orders table Anyone to check this if im wrong?
The Label1.text is a Date
Orders table list correctly
InvoiceNumber ClientNo FirstName LastName ProductName ProductCode Unit Quantity Price TotalPrice DateToday DateToDeliver Address ContactNo