How do I read a delimitted file into a DataTable?

  • Thread starter Thread starter Jim H
  • Start date Start date
J

Jim H

I have a tab delimitted file with many rows. Is there a .NET class that
alread exists to read this file into a DataTable? Or do I just have to read
and parse the data?

Thanks,
jim
 
Thanks for Ravikanth's quick response!

Hi Jim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to get a tab delimitted file
into a DataTable. If there is any misunderstanding, please feel free to let
me know.

Ravikanth has provided us with a good example. Also we can use an ODBC data
provider to achieve this. We can open that file as an ODBC data source with
text driver and use a OdbcDataAdapter.Fill() method to add data to the
DataTable.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Thanks to both of you. Looks like I have to parse it out, but it looks
easier than in would in C. This .NET stuff is great!

jim
 
Back
Top