Afternoon...
I have a small app that loads data from an excel worksheet to a sql server database table via a data table.
I have a column in the spreadsheet that contains a date.
I set the column in the data table thus...
dt.Columns.Add("EffectiveDateOfTransaction_CR0057", typeof(DateTime));
and on processing each row of the spreadsheet into the data table thus...
MyNewRow["EffectiveDateOfTransaction_CR0057"] = (DateTime)(worksheet.Cells[i, 25] as Excel.Range).Value;
I get an exception as DateTime cannot be null.
I have checked the web, but I am pretty new to this, there seems to be something DateTime?, but I cant seem to make it work.
Any help appreciated.
Amit MohantyPosted Jul 19, 2022, 5:07 AM
paul walkerPosted Jul 19, 2022, 1:11 PM
Amit MohantyPosted Jul 19, 2022, 9:13 AM
paul walkerPosted Jul 19, 2022, 7:45 AM
Amit MohantyPosted Jul 19, 2022, 7:15 AM
paul walkerPosted Jul 19, 2022, 7:06 AM
paul walkerPosted Jul 19, 2022, 6:08 AM
Satya KarkiPosted Jul 19, 2022, 3:10 AM
Nitin SontakkePosted Jul 18, 2022, 2:28 PM