packages | uti | id | title | platforms | ||||||
---|---|---|---|---|---|---|---|---|---|---|
|
com.xamarin.workbook |
ebec55fb-e84d-49b1-8817-99ce312d751a |
DataTable AsTable |
|
Add the Slodge extensions package:
#r "Slodge.XamarinWorkbookExtensions"
Create a DataTable using code (normally these get read from a Database)
using System.Data;
var table = new DataTable("A table");
table.Columns.Add(new DataColumn("Name", typeof(string)));
table.Columns.Add(new DataColumn("When", typeof(DateTime)) { AllowDBNull = true });
table.Rows.Add("Yesterday", DateTime.UtcNow.Date.AddDays(-1));
table.Rows.Add("Today", DateTime.UtcNow.Date);
table.Rows.Add("Tomorrow", DateTime.UtcNow.Date.AddDays(1));
table
That was ugly - let’s try it as a table:
table.AsTable()