Home > Forum > ASP.NET > GridViewSample.DataBind();//error occurred

GridViewSample.DataBind();//error occurred

by suprakash   on Mar 13, 2014   Category: ASP.NET  |  Views: 4282    |  Points: 5   |  Starter 
  Reply
I want to get access of data in gridview control from sql database table through stored procedure. In this case, I took help from an article published here. But I faced problem in GridViewSample.DataBind(); and the exception is: "The DataSourceID of 'GridViewSample' must be the ID of a control of type IDataSource. A control with ID 'SqlDataSource1' could not be found."--How to get overcome from this problem?

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :GridViewSample.DataBind();//error occurred   
by Lalitha Singh
on Jun 5 2014 2:56AM
Points : 10
Starter 
just drag and put the gridview on the page and then in cs page just use the id of the grid to bind
as eg:

grd_yearwise.DataSource = ds.Tables[0];
grd_yearwise.DataBind();

Recent Post

Latest Posts