If you are using a grdiview and populating it with large amount of data from database, this type of error occurs , so try using paging on the gridview table. This will solve the problem
Set
allowpaging
property of grid view to true
and set
pagesize
property to no of records you want in each page.
in pageindex changing event write the following code
gridview1.pageindex=e.newpageindex;
gridview1.databind();
Regards,
Abhisheik.yk