hi i have the following query which inserts selected rows from one table into another based on a condition.I get the following error when i use the ExecuteReader() method to fire the query
I get an error saying "Syntax Error in Insert Statement" & the following line gets highlightedCode:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As OleDb.OleDbConnection Dim strinsert As String Dim cmdinsert As OleDb.OleDbCommand con = New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=D:\master.mdb") con.Open() strinsert = "insert into qtest(Qid,Question,Option A,Option B,Option C,Option D,Solution,Date Created) select * from Questionbank where Qid>3" cmdinsert = New OleDb.OleDbCommand(strinsert, con) cmdinsert.ExecuteReader() con.Close()
cmdinsert.ExecuteReader()




Reply With Quote