Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

Reading csv file into datatable.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
archana - 14 Jun 2007 05:52 GMT
Hi all,

I want to read csv file into datatable.  Is there any csv reader and
writer available for freeware.

I am reading csv file using schema.ini file.  I don't want this
dependency.  The problem while reading csv is that datatype depend on
first 8 or 16 rows depend in value set in registry.

Is there any option provided in framework 2.0 to read content of csv
file into datatable properly means without truncation or without data
type conversion?

Please help me asap.

thanks in advance.
Samuel R. Neff - 14 Jun 2007 06:02 GMT
This is a really wonderful CSV reader.  Download project even includes
500+ unit tests.

http://www.codeproject.com/cs/database/CsvReader.asp

Provides both a custom api and an IDataReader implementation.

HTH,

Sam

------------------------------------------------------------
We're hiring!  B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC.  Work with a variety of technologies
in a relaxed team environment.  See ads on Dice.com.

>Hi all,
>
[quoted text clipped - 12 lines]
>
>thanks in advance.
Marc Gravell - 14 Jun 2007 08:09 GMT
Seconded; I use that reader; very effective.

Marc
Michael Nemtsev - 14 Jun 2007 08:52 GMT
Hello archana,

Alternative solution is to use SQL DTS

---
WBR,  Michael  Nemtsev [.NET/C# MVP].  
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

a> Hi all,
a>
a> I want to read csv file into datatable.  Is there any csv reader and
a> writer available for freeware.
a>
a> I am reading csv file using schema.ini file.  I don't want this
a> dependency.  The problem while reading csv is that datatype depend on
a> first 8 or 16 rows depend in value set in registry.
a>
a> Is there any option provided in framework 2.0 to read content of csv
a> file into datatable properly means without truncation or without data
a> type conversion?
a>
a> Please help me asap.
a>
a> thanks in advance.
a>
archana - 15 Jun 2007 06:15 GMT
Hi all,

thanks for replies.

I want to do some validation on that csv file and also wants to update
that csv file.  So my preference is to use it in code in service.

I am facing 2 major problem one is of datatype conversion and other is
if file name contains dot then its not working.

Can you tell me how to solve both this problem.

I am expecting some way to remove this limitation. Is there any
solution in framework 2.0 for this.

thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.