Solved

update datatable when rows are deleted in the database

Posted on 2015-01-08
2
22 Views
Last Modified: 2016-06-23
I fill a datatable from information from a database via a dataadapter.  I have no issues in updating my database from changes in the datatable or updating the datatable from changes in the main database via my dataadapter.

My problem is when I have a deleted row in the main database.  I then call a dataadapter.fill and the rows are updated but the deleted row still exists in the datatable.

Is there a quick way to do a .fill and have it delete the rows in the datatable that were deleted in the main database or at least mark them as deleted?
0
Comment
Question by:hotshottools
2 Comments
 
LVL 33

Accepted Solution

by:
Mike Eghtebas earned 500 total points
Comment Utility
try:

YourDataSet.Reset()
YourTableAdapter.Fill(YourDataSet.table)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now