I'm looking for a function similar to DataTable.Rows.Count that can be used with an SLDocument to find out how many rows have data in them. Is there something available in SpreadsheetLight? Any other methods of achieving this?
-Brendan
The SQL COUNT() function returns the number of rows in a table satisfying the criteria specified in the WHERE clause. It sets the number of rows or non NULL column values. COUNT() returns 0 if there were no matching rows.
SpreadsheetLight is an open source Open XML spreadsheet library for . NET Framework written in C#, and is released under the MIT License.
@@RowCount is a system variable which will have the value of last executed query's number of rows affected. It is used after any type of query such as 'insert', 'Update', 'Delete'. So, @@RowCount is used to check number of rows affected only after a query execution.
SLWorksheetStatistics stats1 = firstdoc.GetWorksheetStatistics();
for (int j = 1; j < stats1.EndRowIndex; j++)
{
var value = firstdoc.GetCellValueAsString(0, j) ;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With