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

Answers were Sorted based on User's Feedback



How to sort the data in Datatable..

Answer / 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

How to sort the data in Datatable..

Answer / narayansahu

pass the datatable in dataview object and call the sort
method on dataview
dataview dv=new dataview(dt)
dv.sort
that's it

Is This Answer Correct ?    17 Yes 17 No

Post New Answer

More ADO.NET Interview Questions

How can you implement sub data grid in a master datagrid?

1 Answers  


what are the two key events for the sql connection class? explain the differnce between the two.

2 Answers   HCL, NIIT, Zensar,


Explain the advantages and disadvantages of using datalist?

0 Answers  


What is the key feature of ADO.NET compared to ADO ?

3 Answers   TCS,


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

0 Answers  


What are the benefits of ADO.NET?

0 Answers   B-Ways TecnoSoft,


Is ADO.NET derived from COM? true /false

2 Answers   Infosys,


What is sqldatasource?

0 Answers  


Which is faster datareader or dataadapter?

0 Answers  


Define atomicity?

0 Answers  


How can I retrieve two tables of data at a time by using data reader? Data reader read and forward only, how is it possible to get 2 tables of data at a time?

0 Answers  


Diff B/W DataSet vs DataTable

6 Answers   Star Wire,


Categories