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 return type of executescalar?

1069


What are the ado.net connection pooling parameters?

1032


What is ado in agriculture?

1008


Explain executenonquery?

1215


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

1093


What is a datareader object?

1139


What are basic methods of dataadapter?

1010


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

1044


What is disconnected scenario in entity framework?

1163


What is a column variable?

983


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

1058


Give an example that shows how to execute a stored procedure in ado.net?

1107


What is difference between datagridview and datagrid control in winforms?

1080


What does ado stand for?

944


How can we load multiple tables in to dataset?

1140