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 oledb driver?

879


Which is faster entity framework or ado.net?

875


What is execute scalar in ado.net?

900


What are the drawbacks of using ado.net?

918


Explian About DataAdapters

966


How do you merge 2 datasets into the third dataset in a simple manner?

944


What is the difference between the clone() and copy() methods of the dataset class?

1010


What is dbcontext and dbset in entity framework?

863


How can I retrieve two tables of data at a time by using data reader?

928


What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?

1271


Which property is used to check whether a DataReader is closed or opened?

991


Why do we need ado.net?

904


What is an ado?

935


What connected data?

886


What is data relation?

848