Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 818 Bytes

DataTable_AsTable.workbook

File metadata and controls

38 lines (29 loc) · 818 Bytes
packages uti id title platforms
id version
Slodge.XamarinWorkbookExtensions
1.0.0
com.xamarin.workbook
ebec55fb-e84d-49b1-8817-99ce312d751a
DataTable AsTable
Console

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()