Hi,
How do I accomplish a rowcount from code-behind? I have a report with two datasources, one is holding header info and the other one is holding detail rows.
I need, in code behind, count the number of rows in the detail datasource. Both datasources are SqlDataSource using SqlClient to connect to MS Sql server.
I have tried put a hidden TextBox in the report and set it's value to Count(Fields.[a field in details]). This gives me the error "An error has occurred while processing Report 'reportname': The expression contains object 'fieldname' that is not defined in the current context" Of course I've doublechecked and 'fieldname' is correct spelled... The field belongs to the details Datasource.
Ideas?