I've got a datatable with 5 columns, that is being filled with data. From here I'm going to the database and save the whole datatable setting it into an transaction.
While saving, I'm getting an error that says "conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value."
As I understand it good, it says that my datatable has a type of datetime2 and my database a datetime?
How can I solve this matter? Has it to be in my code or on database level?
In my datatable the date column is set like this: new DataColumn("myDate", Type.GetType("System.DateTime"))