Solved

update datatable when rows are deleted in the database

Posted on 2015-01-08
2
24 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
ID: 40538977
try:

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

778 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