this the the code for inserting data in a database
Dim cn As New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & Server.MapPath("database.mdb"))
cn.Open()
Dim cmdr As New Data.OleDb.OleDbCommand
cmdr.CommandText = "SELECT [Customer_ID] FROM [Customers] WHERE FirstName LIKE '" & User.Identity.Name & "'"
Dim id As Integer
cmdr.Connection = cn
id = System.Convert.ToInt32(cmdr.ExecuteScalar())
Dim cmd As Data.OleDb.OleDbCommand = New Data.OleDb.OleDbCommand
Dim SQLTxt As String = "INSERT INTO Orders (Customer_ID,Total_price,Delivery,Ordered time)VALUES( '" & id & "','" & lblTotal.Text & "','" & CheckBox1.Checked & "','" & DateTime.Now() & "')"
cmd.Connection = cn
cmd.CommandText = SQLTxt
cmd.ExecuteNonQuery()
cmd.Connection.Close()
the error
Syntax error in INSERT INTO statement.
Line 106: cmd.Connection = cn
Line 107: cmd.CommandText = SQLTxt
Line 108: cmd.ExecuteNonQuery()
Line 109: cmd.Connection.Close()
:-/