best way to check if a datatable is empty
Posted on 2011-09-12
I have a datatable that is part of a class definition.
I will be querying the database the first time this variable is accessed in a private method.
private DataTable _lookup = new DataTable();
What is the best way to do it?
I currently use
_postlablookup.Rows.Count == 0
But it feels like there must be something better. Could I just check for null?
What are the pros and cons of each method?