Exemplo n.º 1
0
 //constructor
 internal CrudOperationsUsingTypedDataSet()
 {
     _adpProducts   = new NorthwindDatasetTableAdapters.ProductsTableAdapter();
     _tblProducts   = new NorthwindDataset.ProductsDataTable();
     _adpCategories = new NorthwindDatasetTableAdapters.CategoriesTableAdapter();
     _tblCategories = new NorthwindDataset.CategoriesDataTable();
     _adpProd1      = new NorthwindDatasetTableAdapters.Products1TableAdapter();
     _tblProd1      = new NorthwindDataset.Products1DataTable();
     _adpSuppliers  = new NorthwindDatasetTableAdapters.SuppliersTableAdapter();
     _tblSuppliers  = new NorthwindDataset.SuppliersDataTable();
 }
Exemplo n.º 2
0
        //method to get all categories
        internal void GetAllCategories()
        {
            _tblCategories = _adpCategories.GetCategories();

            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"{"CategoryID",12} | {"CategoryName",-25}\n");
            Console.ForegroundColor = ConsoleColor.Yellow;
            foreach (var row in _tblCategories)
            {
                Console.WriteLine($"{row.CategoryID,12} | {row.CategoryName,-25}");
            }
            Console.ForegroundColor = ConsoleColor.White;
        }