Esempio 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();
 }
Esempio n. 2
0
        //method to get all suppliers
        internal void GetSuppliers()
        {
            _tblSuppliers = _adpSuppliers.GetSuppliers();

            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"{"SupplierID",12} | {"CompanyName",-25}\n");
            Console.ForegroundColor = ConsoleColor.Yellow;

            foreach (var row in _tblSuppliers)
            {
                Console.WriteLine($"{row.SupplierID,12} | {row.CompanyName,-25}");
            }
            Console.ForegroundColor = ConsoleColor.White;
        }