Exemple #1
0
 static void Main(string[] args)
 {
     string connString =
         @"Data Source = (localdb)\mssqllocaldb; 
             Initial Catalog = DBPenjualanCAT; 
             Integrated Security = True;";
     try
     {
         using (var dao = new SupplierDAO(connString))
         {
             var listData = dao.GetAllDataSupplier();
             if (listData?.Count > 0)
             {
                 listData.ForEach(
                     item => Console.WriteLine($"{item.Kode,-10}{item.Nama}{item.Kota}{item.DataBarang}"));
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine($"Error : {ex.Message}");
         Console.ReadKey();
     }
 }