I m writhing the code as below in the button click event:
Dim count As String = "select max(CutomerId) from CustomerInfo"
cn.Open()
cmd = New OleDbCommand(count, cn)
Dim max1 As String = cmd.ExecuteScalar()
max = Convert.ToInt32(max1)
cn.Close()
cn.Open()
Dim im As String = "insert into CustomerInfo(Address1,Address2,Email,PassPortNo) values('" & txtadd1.Text & "','" & txtadd2.Text & "','" & txtemail.Text & "','" & txtpno.Text & "') where CutomerId= " & max.ToString()
cmd = New OleDbCommand(im, cn)
cmd.ExecuteNonQuery()
cn.Close()
On execution of the code i m getting the error
Missing semicolon (;) at end of SQL statement
could u pls help me to get rid of this error
Note i m using ms-access as my database