Hi,
I am a csv file into a typed datset using the OLEDB provider. However
when the file is read into the dataset via the dataadapter fill method
my field lose there leading zeroes.
I have set the columns in the typed dataset to strings to avoid a
conversion to a numeric value but it seems to drop the zeroes anyway
before placing the data into the dataset.
I have tried using a schema.ini file which works if i pass the data
into a generic dataset but fails if i try to use my typed dataset.
I would have thought as I was using a typed dataset I would not need a
schema.ini anyway?
Any Ideas how to prevent the dropping of leading zeroes?
My code is as follows:
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\CSVTest\\;Extended
Properties='text;HDR=Yes;FMT=Delimited;'";
System.Data.OleDb.OleDbConnection Conn = new
System.Data.OleDb.OleDbConnection(ConnectionString);
Conn.Open() ;
System.Data.OleDb.OleDbDataAdapter da = new
System.Data.OleDb.OleDbDataAdapter("SELECT * FROM Test.csv", Conn) ;
//TestTypeDataset is a typed datset matching data in test.csv
TestTypeDataset FileResults = new FileResults;
da.Fill(FileResults, "FileData");
Conn.Close();
Thanks in advance.