public DataAccessLayer() { adpCategories = new NorthwindDataSetTableAdapters.CategoriesTableAdapter(); tblCategories = new NorthwindDataSet.CategoriesDataTable(); adpSuppliers = new NorthwindDataSetTableAdapters.SuppliersTableAdapter(); tblSuppliers = new NorthwindDataSet.SuppliersDataTable(); adpProducts = new NorthwindDataSetTableAdapters.ProductsTableAdapter(); tblProducts = new NorthwindDataSet.ProductsDataTable(); }
public List <BusinessLogicLayer> GetAllCategories() { tblCategories = adpCategories.GetCategories(); if (tblCategories.Count > 0) { listCategories = new List <BusinessLogicLayer>(); foreach (var row in tblCategories) { BusinessLogicLayer category = new BusinessLogicLayer(); category.Id = row.CategoryID; category.Name = row.CategoryName; listCategories.Add(category); } } return(listCategories); }
public virtual NorthwindDataSet.CategoriesDataTable GetData() { this.Adapter.SelectCommand = this.CommandCollection[0]; NorthwindDataSet.CategoriesDataTable dataTable = new NorthwindDataSet.CategoriesDataTable(); this.Adapter.Fill(dataTable); return dataTable; }