Error while binding data with gridview
-
I have the following coding but when I build it it gives me following error public static DataFeedEntities2 entities = new DataFeedEntities2(); var type = (from p in entities.Address select p); this.GridView2.DataSource = type; this.GridView2.DataBind; ERROR:--> Only assignment, call, increment, decrement, and new object expressions can be used as a statement
-
I have the following coding but when I build it it gives me following error public static DataFeedEntities2 entities = new DataFeedEntities2(); var type = (from p in entities.Address select p); this.GridView2.DataSource = type; this.GridView2.DataBind; ERROR:--> Only assignment, call, increment, decrement, and new object expressions can be used as a statement
The DataBind is a method call and the syntax should be: this.GridView2.DataBind();