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

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.
 
E

Eli

Akir Hello
I Knoe this is old
But did you secseed solvint this.
I have a similer promlem
Thanks
Eli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top