Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete multiple records at once
Message
From
08/01/2008 16:53:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Vista
Database:
VistaDB
Miscellaneous
Thread ID:
01280361
Message ID:
01280377
Views:
31
>Is there a way to delete records from a table without reading through the table and checking each record and then calling dr.delete()?
>
>I'm using datasets,tableadapters and bindingsources in an app where I give the user a combo box populated with unique dates which I have gotten from a transaction table. I want the user to be able to pick a date and then delete all records from the transaction table that have a matching date.
>
>So far I only see that I can loop through the data and test each record and then delete it using the datarow delete(). Seems very inefficient.
>
>Anyone have a better way?
>
>Thanks

You can use Select() to get all those rows into a DataRow[] and delete in a loop. Or you might directly execute a delete command on backend.

Re: How to delete a group of rows from a datatable? Thread #1274269 Message #1274432

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform