Link to home
Start Free TrialLog in
Avatar of omegalove
omegalove

asked on

'System.Data.DataSet' does not contain a definition for 'Any'

protected bool DataSourceIsEmpty(DataSet DataSource)
        {
            return DataSource == null || !DataSource.Any();
        }

Error      8      'System.Data.DataSet' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'System.Data.DataSet' could be found (are you missing a using directive or an assembly reference?)      C:\inetpub\wwwroot\OmegaLove.Web\OmegaLove.Web\Controls\UniGrid.ascx.cs      639      54      OmegaLove.Web
ASKER CERTIFIED SOLUTION
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of omegalove
omegalove

ASKER

I want to create a method to check if a datasource is empty.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nothing null empty no rows.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
       // Summary:
        //     Returns true if the given datasource is empty
        //
        // Parameters:
        //   dataSource:
        //     Datasource to check for emptyness
        public static bool DataSourceIsEmpty(object dataSource);

Not row count should = 0
what else?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks.