How to set the data type to read from a text file

  • Thread starter Thread starter Akira
  • Start date Start date
A

Akira

I am reading a text file with many rows, the columns are separated with ";" .
On one column, named "agent" I have diferent types of data, text and numbers.
I am using the following code to read the text file:

OleDbConnection cnnT = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;"
+ "Data Source=" + cale + ";"
+ "Extended
Properties='text;HDR=Yes;FMT=Delimited';");
cnnT.Open();
OleDbDataAdapter da = new OleDbDataAdapter("Select * from test.txt", cnnT);
ds.Clear();
da.Fill(ds,"Table1");

My problem is ,that after the data is read, in the column "agent" all the
rows where i have strings, or where the numbers are larger then 10 digits,
the value in my dataSet is null. So I only read numbers that are smaler then
10 digits.

How can I set the data type to read?
I have tried to use a schema.ini file, but it dose not work.
 
Akir Hello
I Knoe this is old
But did you secseed solvint this.
I have a similer promlem
Thanks
Eli
 
Back
Top