using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UsingTypedDataSet : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
SampleTypedDataSet ds = new SampleTypedDataSet();

       SampleTypedDataSet.CustomersRow r1 = ds.Customers.NewCustomersRow();       
       r1.FirstName = "Thomas";
       r1.LastName = "Hobbes";
       r1.Phone = "123-4567";
       ds.Customers.Rows.Add(r1);

       SampleTypedDataSet.CustomersRow r2 = ds.Customers.NewCustomersRow();
       r2.FirstName = "David";
       r2.LastName = "Hume";
       r2.Phone = "564-7823";
       ds.Customers.Rows.Add(r2);

       labSingle.Text = ds.Customers[0].LastName;

       grdCustomers.DataSource = ds.Customers.DefaultView;
       grdCustomers.DataBind();

 SampleTypedDataSet.ProductsRow p1 = ds.Products.NewProductsRow();
 p1.Name = "Book";
 p1.Price = 49.99;
 ds.Products.Rows.Add(p1);

 SampleTypedDataSet.ProductsRow p2 = ds.Products.NewProductsRow();
 p2.Name = "Apple";
 p2.Price = 1.99;
 ds.Products.Rows.Add(p2);

 grdProducts.DataSource = ds.Products.DefaultView;
 grdProducts.DataBind();
    }
}
