I have c # winforms that reads a column from a csv file. It reads 3 of 4 columns correctly. The 4th column in the csv S4 file, but 4 displayed in the dataset.
Code:
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);
Example csv data:
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 can cause this and how can I solve it?
source share