PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
How to set the data type to read from a text file
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
How to set the data type to read from a text file
![]() |
How to set the data type to read from a text file |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

