I am trying to take number of variables from my database with a where condition but I get an error like
'LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method'.
Here is my code:
var tickets = (from a in user.TicketTable where a.HandlerId == int.Parse(Session["emp"].ToString()) && a.Done == true select a.TicketId);
int count = 0;
foreach (var n in tickets)
{
count++;
}
lblDone.Text = count.ToString();
I tried other methods to convert my session to int but they all gave the same result.