Soham Dasgupta
Soham Dasgupta

Reputation: 5199

.NET DataSet filtering

We are using the .NET DataSet and DataTable classes to filter data. But we have two tables with almost 596,814 records in one table and around 10,000 records in the other. DataSet filtering using DataTable.Select is massively slow.

Are there any faster approaches?

Upvotes: 1

Views: 386

Answers (2)

sestocker
sestocker

Reputation: 3532

Do your filtering at the database if possible, especially if it is a web app. If it is a client app, do as many optimizations as possible - but it is always going to be a little slow on a half million records. Make sure your app communicates that it is working to the user.

Upvotes: 1

Joel Etherton
Joel Etherton

Reputation: 37533

Use the DefaultView of the DataTable and set its .Filter property. Much faster than Select().

Upvotes: 0

Related Questions