I learnt this programming from other sources, and I also downloaded his file to test is it works. I did everything same with him, but mine is not works and not coming out any errors. Could any senior help me to do some correction or debug.
This is my code:
Dim Command As New OleDb.OleDbCommand Dim Adapter As New OleDb.OleDbDataAdapter Dim Connection As OleDb.OleDbConnection = AConnection() Public Function AConnection() As OleDb.OleDbConnection Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\Music_Sales_Database.mdb") End Function Private Sub SendCustomerInformationToDatabase() Connection.Open() With Command .Connection = Connection .CommandText = "INSERT into Customer(Customer_ID,First_Name,Last_Name,Contact_Number,Email_Address) " & _ "Values('" & txtCustomerID.Text & "','" & txtFirstName.Text & "','" & txtLastName.Text & "','" & txtContactNumber.Text & "','" & _ "','" & txtEMail.Text & "')" End With Connection.Close() End Sub Private Sub CheckOut_Reservation_Load(sender As Object, e As EventArgs) Handles MyBase.Load txtDateOfReservation.Text = Date.Today txtCustomerID.Focus() InputText = txtContactNumber.Text NumericCheck = IsNumeric(InputText) Connection.Open() With Command .Connection = Connection .CommandText = "SELECT * from Customer" End With Dim Table As New DataTable Adapter.SelectCommand = Command Adapter.Fill(Table) Connection.Close() Adapter.Dispose() End Sub Private Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click SendCustomerInformationToDatabase() Dim CheckOutSound As String Dim path = System.Windows.Forms.Application.StartupPath Dim MyPlayer As New SoundPlayer() CheckOutSound = "\Success.wav" MyPlayer.SoundLocation = path & CheckOutSound MyPlayer.Play() If AInputCorrect = True And BInputCorrect = True And CInputCorrect = True And DInputCorrect = True And EInputCorrect = True Then FInputCorrect = True Else FInputCorrect = False End If If FInputCorrect = True Then MessageBox.Show("Reservation Submitted.", "Reservation Successful", MessageBoxButtons.OK, MessageBoxIcon.None) End If If FInputCorrect = False Then MessageBox.Show("Please check your Customer Information and try again.", "Reservation Failed", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) End If 'Me.Close() End Sub Thank You