i cant find the problem can anyone help me pls???
If userNameTextBox .Text <> "" Then
Dim sqlQRY As String = "INSERT INTO SalesOrder Values ('" & salesNoTextBox. Text & "', '" & orderDateTextBo x.Text & "', '" & userNameTextBox .Text & "', '" & productCodeText Box.Text & "', '" & quantityTextBox .Text & "')"
Try
conn.Open()
Dim cmd As OleDbCommand = New OleDbCommand(sq lQRY, conn)
cmd.ExecuteNonQ uery()
Catch ex As OleDbException
MsgBox("Error: " & ex.ToString & vbCrLf)
Finally
conn.Close()
End Try
saveButton.Enab led = False
Else
MsgBox("Please select customer")
userNameTextBox .Focus()
End If
If userNameTextBox .Text <> "" Then
Dim sqlQRY As String = "INSERT INTO SalesOrder Values ('" & salesNoTextBox. Text & "', '" & orderDateTextBo x.Text & "', '" & userNameTextBox .Text & "', '" & productCodeText Box.Text & "', '" & quantityTextBox .Text & "')"
Try
conn.Open()
Dim cmd As OleDbCommand = New OleDbCommand(sq lQRY, conn)
cmd.ExecuteNonQ uery()
Catch ex As OleDbException
MsgBox("Error: " & ex.ToString & vbCrLf)
Finally
conn.Close()
End Try
saveButton.Enab led = False
Else
MsgBox("Please select customer")
userNameTextBox .Focus()
End If
Comment