I have a DataSet
where I need to find out how many rows has been changed using the following code:
dataTable1 = dataSet1.Tables[\"FooTable\"].Ge
As from MSDN for GetChanges
A filtered copy of the DataTable that can have actions performed on it, and later be merged back in the DataTable using Merge. If no rows of the desired DataRowState are found, the method returns Nothing (null).
dataTable1
is null so just check before you iterate over it.
This is an old question, but because this might help a lot of c# coders out there, there is an easy way to solve this right now as follows:
if ((dataTableName?.Rows?.Count ?? 0) > 0)