Filtering and Sorting in ADO.NET


ADO.NET supports many ways to manage memory-resident data returned in a DataSet. In this article you will see that ADO.NET exposes addidional functionality to the ways you can sort and filter data.

Because of the very nature of the disconnected DataSet architecture used in ADO.NET, it's often impractical or impossible to requery a remote data source to reorder or further filter data. Of course, this assumes that you are not implementing a traditional client/server application, which can execute further server-side sorting and filtering.

ADO.NET supports two fundamental approaches for performing these operations:

  • The DataTable Select Method - This method is overloaded to accept arguments to filter and sort data rows returning an array of DataRow objects.
  • The DataView object sort, filter and find methods - This object uses the same filter arguments supported by the Select method, but the DataView extrudes structures that can be bound to data-aware controls.

You might also like...



Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++ : Where friends have access to your private members.” - Gavin Russell Baker