Library tutorials & articles

Filtering and Sorting in ADO.NET

Overview

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.

Comments

  1. 23 Apr 2007 at 20:13

    I have been looking for a recordset.requery equivalent in ADO.NET forever and have neither found the method or a workaround.  I use this all the time in my current app and cannot do without.  Any suggestions.

  2. 30 Sep 2006 at 21:51

    hi .:)

    I'm a new comer .. dun know much about C#, ado.net but I 'm on assignment like a project :(

    I want to put sql statement like "select distinct column from table" in dataview.rowfilter .  how can I do that ?

    I want a distinct column value in my cbobox how could I support to do that ?

    can you guide me a way ? exam is around the corner and me havnt finish the assignment yet.  pls.....

     

    parden me for my bad english !

  3. 09 Dec 2005 at 09:55

    how can we get the circle shape of image in  asp.net using c#.net?

  4. 01 Jan 1999 at 00:00

    This thread is for discussions of Filtering and Sorting in ADO.NET.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related podcasts

  • A Practical Look at Silverlight 2 Part 1

    Now that Silverlight 2 is at the Olympics and making a big splash, we wanted to explore this fascinating technology more. Microsoft Silverlight 2 is a cross-browser, cross-platform, and cross-device plug-in for delivering the next generation of .NET based media experiences and rich interactive ap...

Events coming up

  • Dec 6

    Developing AJAX Web Applications with Castle Monorail

    London, United Kingdom

    Monorail is the model-view-controller engine of the Castle Project, bringing many of the best ideas of Ruby on Rails to the .NET world. In this talk, David De Florinier and Gojko Adzic show how Monorail makes it easy to develop .NET based AJAX applications, and how to use the Castle Project to build Web 2.0 applications effectively. Come to this session if you are a .NET web developer. Everyone is welcome!