protected void Page_Load(object sender, EventArgs e) { if (!checkCookie()) Response.Redirect("Login.aspx"); String sellerUsername = Request.Cookies["Car-Trading"]["Username"].ToString(); DataSet ds = new DataSet(); DatabaseHandler obj=new DatabaseHandler(); ds = obj.GetSellerId(sellerUsername); String sellerId = ds.Tables[0].Rows[0]["SELLER_ID"].ToString(); ds = obj.GetSellerCarStock(sellerId); GridView1.DataSource = ds; GridView1.DataBind(); }