Syntax Error in Insert Into statement. pls give correct code for me.
Imports System.Data
Imports System.Data.OleDb
Partial Class login
Inherits System.Web.UI.Page
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & Server.MapPath("login.mdb") & ";")
cn.Open()
cmd = New OleDb.OleDbCommand("INSERT INTO user VALUES ('" & (TextBox1.Text) & "','" & (TextBox2.Text) & "')", cn)
cmd.ExecuteNonQuery()
MsgBox("data Inserted")
cn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class