I am getting Object Null Reference error. I tried checking for null as done below but I am still getting the error.
List<Data> gvdta = (List<Data>)Session["Items"];
switch (this.dd_search.SelectedValue)
{
case "emp":
var tb = (from ad in gvdta
where ad!=null & ad.emp.ToLower().Contains(this.txt_Search.Text.ToLower())
select ad);
gvdta = tb.ToList();
break;
}
Is there any other way? Please help.Thank you.