How to: Get Top n Rows of DataView in C# asp.net
DataView in asp.net doesn't have any method of returning Top n rows or it doesn't accept any row filter string such as, dataview.RowFilter = "top 100". So to server the purpose you can use the method below to get top n rows from DataView. private DataView GetTopDataViewRows(DataView dv, Int32 n) { DataTable dt = dv.Table.Clone(); for (int i = 0; i { if (i>= dv.Count) { break; } dt.ImportRow(dv[i].Row); } return new DataView(dt, dv.RowFilter, dv.Sort, dv.RowStateFilter); }
sunny, please go to gumball dot com/contact.aspx and either email or call me.
ReplyDeletespencer
baah jotil to.. series ta amar heavy prio :-D
ReplyDeleteera amader uni te ashchilo oder ekta advertisement er jonno....bishal ekta caravan niye koto gula uni te ora visit korse....r oi billboard er majhe boshey shoabi chabi tulse :P..amar chabi ta funny asche na? :)
ReplyDelete