I am writing following code:
namespace WebApplication5
{
public partial class WebForm1 : System.Web.UI.Page
{
private DataSet dataset1 = new Data
You don't get Data in the dataset in button2_click because button1_click and button2_clicks are entirely different requests to the server. And asp.net does not persists data stored in variables between requests. If you need to persist data you should use any State Management techniques provided by asp.net, like Session or Viewstate or Caching.