updating, deleting in access with asp.net using Visual basic

5 pts.
Tags:
ASP.NET
Microsoft Access 2003
VB.NET
Visual Basic
hi, i m using  asp.net 2005 usin vb. i m having gridcontrol with the back end of msaccess.  i know to retrive the data from databse by using tis code, Dim msaccessconnect, query, databasecommunication, readdatabase         msaccessconnect = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("db1.mdb"))         msaccessconnect.Open()         query = "SELECT * FROM `advertiser`"         databasecommunication = New OleDbCommand(query, msaccessconnect)         readdatabase = databasecommunication.ExecuteReader()         GridView1.DataSource = readdatabase         GridView1.DataBind()         readdatabase.Close()         msaccessconnect.Close() but i dont know to write the code for editing, updating and deleting. HELP ME anyone!!!!!!!!!!! PLEASE!!!!!!!

Answer Wiki

Thanks. We'll let you know when a new response is added.

You would update or delete records almost the same way as executing the query to populate your grid, but you would use the ExecuteNonQuery method:

<pre>
query = “DELETE FROM advertiser WHERE <some_column> = <something>”
UpdateOrDeleteCommand = New OleDbCommand(query, msaccessconnect)
UpdateOrDeleteCommand.ExecuteNonQuery()
</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following