I want to save current date and time . i am adding it into datacolumn.but it giving error for IMPORT_DATE_TIME.
My Code in cs file is as follow
- DataTable dt = new DataTable();
- dt.Columns.AddRange(new DataColumn[3] {
- new DataColumn("SRNO", typeof(Int32)),
- new DataColumn("BANKID", typeof(Int32)),
- new DataColumn("IMPORT_DATE_TIME",typeof(DateTime),System.DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss tt"))
- });
It gives error Syntax error: Missing operand after '13' operator.


Sachin SinghRank #66 · 26.2K reputationPosted Sep 29, 2020, 11:28 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 3, 2020, 8:43 PM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Oct 9, 2020, 7:04 AM EDT