Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to sort the data in Datatable

Answer Posted / kamalakannan.a

I think the above answer is correct.Another one method is

DataTable dt=new DataTable();
DataRow[] dr=dt.Select("Filter Expression","Sort
expression");

Here Sort expression is , for eg.Address is one of the
field in dt.

Then DataRow[] dr=dt.Select("","Address ASC");

But in this method is have the Datarow array.So you can use
another one method,I explain below.

DataView dv=new DataView(Datatable,Filter Exp,Sort
Exp,Dataviewrowstate)


Eg is

DataView dv=new DataView(dt,"","Address
ASC,DataViewVowState.CurrentRows);


Here we can copy this Dataview to datatable or use this
same dataview instead of datatable.

Kamal....

Is This Answer Correct ?    28 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Response.Expires and Reponse.ExpiresAbsolute?

980


Explain how to call the sql commands asynchronously in ado.net version 2.0?

886


What is the functionality of data provider in ado.net?

871


What are the parameters that control most of connection pooling behaviors?

945


What are the key features of ado.net?

1127


What is bubbled event?

916


What is different between sqlcommand object and command behavior object?

986


Describe datareader object of ado.net with example.

874


How do I delete a row from a DataTable?

1079


What are the advantages of using datalist?

962


Define data adapter?

896


What is the executescalar method?

1022


How do you implement locking concept for dataset?

940


What are dcl commands?

958


How to bind the controls(best practice) comboboxes to the data in the dataset?

1005