Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
597
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. public DataTable GetTable()
  2.     {
  3.         // Here we create a DataTable with four columns.
  4.         DataTable table = new DataTable();
  5.         table.Columns.Add("Dosage", typeof(int));
  6.         table.Columns.Add("Drug", typeof(string));
  7.         table.Columns.Add("Patient", typeof(string));
  8.         table.Columns.Add("Date", typeof(DateTime));
  9.         table.Columns.Add("testColumn", typeof(DateTime));
  10.  
  11.         // Here we add five DataRows.
  12.         table.Rows.Add(25, "Indocin", "David", DateTime.Now);
  13.         table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
  14.         table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
  15.         table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
  16.         table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
  17.         return table;
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement