Ok please excuse my references to the gridview.
So i have this method in a class called getall() what this does is gets the collection of entites from entity framework model for a specfic table, checks to see whether the table exists and then does the query using linq (linq to entities). This does work as I have used a breakpoint and even created a seperate test project in order to test it. However when binding it with a gridview has proven difficult for me.
This is the code i used:
protected void Button2_Click(object sender, EventArgs e)
{ dCollection d = new dCollection(); GridView1.DataSource = d.GetAll(); GridView1.DataBind(); }
However i get an error saying: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection. Am using a collection to get all my methods from the class dcollection and one of my methods is getall, which will get all records from the table. Why does this not work?