Can't insert data into database
Hello
actually i try to do a database program using asp.net the problem with me is i'm using access as database and when i'm try to insert new record into database it showing the error as "Operation must use an updatable query". and my code is:
private sub button1_click(Byval sender as system.object, byval e as system.eventargs) handles button.click
dim cn as oledbconnection
dim cmd as oledbcommand
dim da as oledbdataadapter
cn=new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=d:\tong\last.mdb")
cmd.commandtext="insert into master values(" & textbox1.text & ",'" & textbox2.text "')"
cmd.connection=cn
try
cn.open()
cmd.executenonquery()
catch ex as exception
response.write(ex.message)
finally
cn.close()
end try
end sub
please suggest solution for this problem to me
thanks
Tong
|