In a WPF application, I would like to check if the LINQ to SQL query return contains some entries, but my approach does not work:
TdbDataContext context = new TdbDataContext();
var sh = from p in context.Items where p.Selected == true select p;
if (sh == null)
{
MessageBox.Show("There are no Selected Items");
}
Where am I mistaken?
source
share