开发者

DataRow[] Aggregate Functions C# - Appendix

开发者 https://www.devze.com 2023-03-29 02:47 出处:网络
My question arised out of the accept answer here: DataRow[] Aggregate Functions C# In that answer, how is the \"rows\" object intialized?

My question arised out of the accept answer here:

DataRow[] Aggregate Functions C#

In that answer, how is the "rows" object intialized?

EDIT: In my case, I have mydataset.Tables[0].Rows collection, from 开发者_如何学JAVAwhich I need to SUM a particular column.


Well you can create your own list of DataRow

List<DataRow> listOfRows = new List<DataRow>();

Or you can get collection of them from GridView.

var rows = gridView.Tables[0].Rows; //will return a collection of DataRows from your Gridview

Or from DataSet

var rows = dataSet.Tables[0].Rows;


Probably from a LINQ query like:

List<DataRow> rows = (from row in mydataset.Tables[0].AsEnumerable()
                      select row).ToList();
0

精彩评论

暂无评论...
验证码 换一张
取 消