I cant seem to add a value to a datatable in C#. I have done my research and cannot figure out what I am missing. I can print the value to console but when I try to assign and add System.Data.DataRow. Its probably a simple solution but I cannot figure it out to save the life of me.
worktable is new datatable
foreach(var ts in timeSeries_ind)
{
Bar mbar = ts as Bar;
DataRow newr = workTable.NewRow();
newr["Date/Time"] = mbar.DateTime;
Console.WriteLine(mbar.DateTime);
workTable.Rows.Add(newr); //newr
Console.WriteLine(newr.ToString());
}
Firstline prints fine to console Second when trying to view Data.DataRow