I need to add the data by three text boxes and coding is shown as below, there is no error popped up for this but the data cannot be added. May i know why? Thank you.
VB.NET:
Dim DBPath As String
DBPath = System.AppDomain.CurrentDomain.BaseDirectory & "edatabase.mdb"
OleDbConnection1 = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & "DATA SOURCE=" & DBPath)
Dim Command As OleDb.OleDbCommand
Dim SQLSTRING As String = "SELECT * FROM Employee"
Dim DAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(SQLSTRING, OleDbConnection1)
Command = New OleDb.OleDbCommand("INSERT INTO Employee (ID, Name, ContactNo) " & "VALUES (EId.text, EName.text, EContactNo.text)", OleDbConnection1)
Command.Parameters.Add("EID.text", OleDb.OleDbType.Char, 200, "ID")
Command.Parameters.Add("EName.text", OleDb.OleDbType.VarChar, 200, "Name")
Command.Parameters.Add("EContactNo.text", OleDb.OleDbType.VarChar, 200, "ContactNo")
DAdapter.InsertCommand = Command