I get this error:
Data source is an invalid type. It must be either an IListSource, IEnumerable, or IDataSource.
My code:
protected void Button1_Click(object sender, EventArgs e)
{
JobShopEntities job = new JobShopEntities();
GridView1.DataSource = (from x in job.JobDescriptions where (x.Titlu == TextBox1.Text) select x).First();
GridView1.DataBind();
}
I searched a lot for a solution.. From here I got this solution.
Rest of the code on back end in case have something to do with the error.
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridViewRow row = GridView1.Rows[e.NewEditIndex];
int rowId = Convert.ToInt32(row.Cells[1].Text);
Response.Redirect("~/Administrator/Management/ManageJobs.aspx?id=" + rowId);
}