i am working on a project in vb10 i want simple code to add delete or update record in ms access by a click of button, please help me
Printable View
i am working on a project in vb10 i want simple code to add delete or update record in ms access by a click of button, please help me
i am new to vb please reply soon, i am attaching my project zip file
If you follow my VB tutorial link in my signature, there is a database connection section which should be what you're after.
i am very new to vbforum please tell me how to go to that link, please
and thanks for your quick reply.
Click here
ok, i got it and reading this. this is very helpful. if i got my problem solved then reply soon or i will get more help from you. thanks again.
I'd recommend finding some time and sitting down through the entire tutorial, it'll really benefit you.
this really help me a lot much. but not fully solved my problem. this will update records and show when i restart project i want records to be updated without closing project. please reply soon.
If you aren't seeing changes until you restart then you're doing it wrong. You should be editing the local data first, before saving anything to the database. The sequence of events should basically be like this:
1. Use a DataAdapter to retrieve data from the database and populate a DataTable.
2. Display that data in your application if appropriate, by binding the DataTable to a DataGridView or other controls.
3. Edit the data contained in the DataTable, either in code or by the user through the UI.
4. Use the same DataAdapter to save the changes from the DataTable back to the database.
As you can see, what you're asking for is already accomplished in step 3, before any changes are saved to the database in step 4. I don't know what's in OhGreen's tute but I can tell you that if you follow the CodeBank link in my signature and check out my thread on Retrieving & Saving Data, which includes two examples of using a DataAdapter.
OhGreen,
I have gone through a lot of the tut, but have run into some problems associated with the question in this thread. You can see my post here. It is directly related to adding or updating records in a database from your tut.
Not to hijack thread, but it seems like we are having similar needs and issues.
BTW, I went back through the tutorial and everything works as advertised. Thanks again! Great resource...