String is converted to DateTime when putting it to a System.Data.DataTable
user454 Published in June 19, 2018, 2:22 pm
I'm populating a datatable with values, and one of them is the following string: "1/1/1801".
In my array "values", that item is of String type.
But when I assign the array to a System.Data.DataTable row, it magically turns into a datetime type:
System.Data.DataTable dt = new System.Data.DataTable();
dt.Rows.Add(dt.NewRow().ItemArray = values);
Waht's going on here and is there any way to avoid that?