Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have the following codes:

ReportDataSource[] _reportDataSources = new ReportDataSource[1];
_reportDataSources[0] = GetDeviceHistoryData(unitheaderid);

How can I get the "Row" inside of it? When I mouse over the _reportDataSources[0] during debug, I can get "Value" and inside "Value" I have "Row". I want to get the "Row" count.
If count is 0, then I will do my logic.
I have tried below but the "Row" cannot coming out:

if(_reportDataSources[0].Value.....){}

After Value, then it will not show Row for me to select.
Posted

1 solution

Hi, after some research, I have come out with the following solution:

C#
DataTable dtDeviceHistory = new DataTable();
dtDeviceHistory = (DataTable)_reportDataSources[0].Value;

if (!dtDeviceHistory.IsNullOrEmpty())
{
    if (dtDeviceHistory.Rows.Count > 0)
    {
        DisplayReport(_reportDataSources, _unitDto);
    }
}


Hope to get some feedback. Thank you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900