简体   繁体   中英

Storing values into report variable in SSRS reporting

我正在asp.net中制作一个报告,为此,我想将数据表中的数据存储到报告变量中,但是问题是我希望将第三行第二列数据转换为变量,我不知道该怎么做,请提供我有什么建议。

The DataRow has also an indexer :

Object cellValue = dt.Rows[3][2];

But i would prefer the strongly typed Field extension method which also supports nullable types:

int number = dt.Rows[3].Field<int>(2);

or even more readable and less error-prone with the name of the column:

double otherNumber = dt.Rows[3].Field<double>("SecondColumnName");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM