Esempio n. 1
0
        public DataTable GetProducts()
        {
            ProductsTableAdapter adapter = new NorthWindDataSetTableAdapters.ProductsTableAdapter();

            global::ClassLibrary3.NorthWindDataSet northwindDataSet1 = new NorthWindDataSet();
            adapter.Fill(northwindDataSet1.Products);

            return(northwindDataSet1.Products);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            using (NorthWindDataSet ds = new NorthWindDataSet())
            {
                using (WebApplication1.NorthWindDataSetTableAdapters.EmployeesTableAdapter taEmployees
                           = new NorthWindDataSetTableAdapters.EmployeesTableAdapter())
                {
                    taEmployees.Fill(ds.Employees);
                    //adapter will take data from database and fill it in our dataset
                    //creating a in memory database as dataset object.

                    //fill our gridview with dataset employees
                    this.GridView1.DataSource = ds.Employees;

                    //populating every record
                    this.GridView1.DataBind();
                }
            }
        }