I have a C# winforms that is reading a column from a csv file. It reads 3 of the 4 columns correct. The 4th column in the csv file is S4
, but the dataset is displaying 4
.
The code is:
string conn = string.Format(@"Provider=Microsoft.Jet.OLEDB.4.0; Data"
+ "Source={0}; Extended Properties=""text;HDR=YES;FMT=DELIMITED""",
strDirectoryPath);
OleDbConnection oleDBConn = new OleDbConnection(conn);
oleDBConn.Open();
OleDbDataAdapter da = new OleDbDataAdapter("Select * FROM [" + strFileName + "]",
conn);
DataSet ds = new DataSet();
da.Fill(ds);
csv data sample is:
AA0013 Incident Incident S4
AA0016 Incident Incident S3
AA0017 Incident Incident S3
AA0023 Incident Incident S3
AA0076 Issue Issue S3
AA0079 Incident Incident S6
AA0082 Issue Issue S6
AA0084 Incident Incident S6
AA0085 Incident Incident S6
What would cause this and how can I resolve it?