I am trying to show all the data of t1 table in a gridview using Entity Framework but I am getting an error
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression.
This is my code:
protected void Button2_Click(object sender, EventArgs e)
{
var v = (from obj in de.t1
where obj.Id == Convert.ToInt32(TextBox5.Text)
select obj).ToList();
GridView1.DataSource = v;
GridView1.DataBind();
}