?
Solved

DataGridView not Updating backend database in Access when deleting records in grid

Posted on 2010-04-06
7
Medium Priority
?
487 Views
Last Modified: 2012-06-27
vb.net 2008
msaccess 2003

I have form bound to a  BindingNavigator1 and dataset

So when I press the command button to delete a record... It deletes it in the datagridview  but not in the backend database...
"Allowuserstodeleterows"   is set to "true" in the datagrid properties.. ?


Thanks
fordraiders
0
Comment
Question by:Fordraiders
  • 4
  • 3
7 Comments
 
LVL 6

Expert Comment

by:mohd_haq
ID: 29937230
Hi,
Did you clicked the saved button on the binding navigator after deleting record? This is usually a floppy icon on the binding navigator. when you click delete button, it deleted from the datagridview but is only reflected to the database only when saved usin the save button. Hope this helps.
0
 
LVL 3

Author Comment

by:Fordraiders
ID: 29939544
yes...but is not updating backend table in access.
0
 
LVL 6

Accepted Solution

by:
mohd_haq earned 2000 total points
ID: 29946064
Hi,
I think your database should be updated when you save it using the save button on the binding navigator. I think you might be missing something. I think you need to have a new button on the binding navigator that upon clicked will save the changes to the Database. I will Update you on this soon.
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
LVL 3

Author Comment

by:Fordraiders
ID: 29946066
I just created s new datasource and binded it to a table instead of a view...!

0
 
LVL 3

Author Closing Comment

by:Fordraiders
ID: 31711481
But your suggestion helped...Thanks !
0
 
LVL 6

Expert Comment

by:mohd_haq
ID: 29947350
Hi,
One thing i want ot ask you is that did you added your access database to the project i.e., when you add new data source to your solution, the wizard will ask you to whether or not add this database file to the project. if you had selected yes, a copy of that file will be added to your project. though you have a database file in your project, when you debug it, this file is not modified. The file in the bin\debug folder is modified. So, when you have deleted and saved the data in  your form, check the database file in bin\debug folder for changes. Let me know if this isn't the case.
0
 
LVL 3

Author Comment

by:Fordraiders
ID: 29985879
no I did not save it into my current project..
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month6 days, 23 hours left to enroll

593 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question