hello
iam using visual basic 2012 i want to add into access 2013 DB
what the error in the code ??
i need a help please
cBoxCustNames = ( ComboBox )
iam using visual basic 2012 i want to add into access 2013 DB
what the error in the code ??
Code:
Private Sub btnadd_Click(sender As Object, e As EventArgs) Handles btnadd.Click
If cBoxCustNames.Text = "" Then
MessageBox.Show("Please fill in the Customer name", "Pharmacy System")
cBoxCustNames.Focus()
ElseIf txtMobile.Text = "" Then
MessageBox.Show("Please fill in the Mobile", "Pharmacy System")
txtMobile.Focus()
ElseIf txtPrice.Text = "" Then
MessageBox.Show("Please fill in the Price", "Pharmacy System")
txtPrice.Focus()
ElseIf txtBalance.Text = "" Then
MessageBox.Show("Please fill in the pharmacist Balance", "Pharmacy System")
txtBalance.Focus()
ElseIf txtForm.Text = "" Then
MessageBox.Show("Please fill in the pharmacist Form", "Pharmacy System")
txtForm.Focus()
ElseIf txtdate.Text = "" Then
MessageBox.Show("Please fill in the pharmacist Date", "Pharmacy System")
txtdate.Focus()
ElseIf txtorder.Text = "" Then
MessageBox.Show("Please fill in the pharmacist Order", "Pharmacy System")
txtorder.Focus()
Else
Try
conn.Open()
Dim cmd As New System.Data.OleDb.OleDbCommand("Insert Into Customers (CustName,CustMobile,OrderPrice,OrderBlanace,CustForm,DateOrder,CustomerOrder) values ('" & cBoxCustNames.Text & "','" & txtMobile.Text & "','" & txtPrice.Text & "','" & txtBalance.Text & "','" & txtForm.Text & "','" & txtdate.Text & "','" & txtorder.Text & "')
Dim dr As System.Data.OleDb.OleDbDataReader
conn.Close()
MessageBox.Show("details have been added successfully.", "Pharmacy System", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Hide()
Catch ex As Exception
MessageBox.Show(ex.Message, "btnadd_Click")
End Try
End If
End Sub
End Class
cBoxCustNames = ( ComboBox )