So I have quite a problem over here and its wrecking my brain.
I am reading in information from a csv file. the contents (or a row to be specific) of the file looks like:
1763275,95603462,NDBKPOS 1102I,EFT930G_16,CONNECTNET SIM,ACTIVE,RESTAURANT,RFU,2014/01/30 10:15:11,RFU,RFU,UN,
In the above row you will see a date. When filling my datatable, this date is converted to this type of format:
2012/08/19 08:55:50 PM
How can I ensure that my datatable does not change the format? I need it to be exactly the same as the date that I first specified? 2014/01/30 10:15:11, or even this: 2014-04-07 16:24:55.342123
using (OleDbCommand cmd = new OleDbCommand(string.Format
("SELECT * FROM " + SourceFile + ""), con))
{
con.Open();
using (OleDbDataAdapter adp = new OleDbDataAdapter(cmd))
{
using (DataTable tbl = new DataTable("MyTable"))
{
adp.Fill(tbl);
List<string> CAMSMerchantNumber = tbl.AsEnumerable().Select(x => x[0].ToString().PadLeft(10, '0')).ToList();// pad values and store it in a list
List<string> TerminalNumber = tbl.AsEnumerable().Select(x => x[1].ToString().PadLeft(10, '0')).ToList();// pad values and store it in a list
List<string> TerminalSoftwareVersion = tbl.AsEnumerable().Select(x => x[2].ToString().PadLeft(30, '0')).ToList();
List<string> TerminalType = tbl.AsEnumerable().Select(x => x[3].ToString().PadLeft(15, '0')).ToList();
List<string> TerminalModemType = tbl.AsEnumerable().Select(x => x[4].ToString().PadLeft(20, '0')).ToList();
List<string> TerminalStatus = tbl.AsEnumerable().Select(x => x[5].ToString().PadLeft(10, '0')).ToList();
List<string> MerchantCategory = tbl.AsEnumerable().Select(x => x[6].ToString().PadLeft(15, '0')).ToList();
List<string> LastUsedCommsType = tbl.AsEnumerable().Select(x => x[7].ToString().PadLeft(10, '0')).ToList();
List<string> TerminalLastTimeConnected = tbl.AsEnumerable().Select(x => x[8].ToString()).ToList();