473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reading csv file into datatable.

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.

Jun 14 '07 #1
4 11075

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.

On Wed, 13 Jun 2007 21:52:36 -0700, archana
<tr**************@yahoo.comwrote:
>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.
Jun 14 '07 #2
Seconded; I use that reader; very effective.

Marc
Jun 14 '07 #3
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

aHi all,
a>
aI want to read csv file into datatable. Is there any csv reader and
awriter available for freeware.
a>
aI am reading csv file using schema.ini file. I don't want this
adependency. The problem while reading csv is that datatype depend on
afirst 8 or 16 rows depend in value set in registry.
a>
aIs there any option provided in framework 2.0 to read content of csv
afile into datatable properly means without truncation or without data
atype conversion?
a>
aPlease help me asap.
a>
athanks in advance.
a>
Jun 14 '07 #4
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.
Jun 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
1
by: John Beavers | last post by:
I have a file that is tab delimited and has no header row with column headings. What is the best method for reading this data into a dataset?
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
4
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
12
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my...
0
by: Anish G | last post by:
Hi, I have an issue with reading CSV files. I am to reading CSV file and putting it in a Datatable in C#. I am using a regular expression to read the values. Below is the code. Now, it reads...
1
by: ebenl555 | last post by:
i am writing code to import data from an .xls file into a db using an oledbadapter to fill a datatable. I can access most of the values easily using this method. i do however have problems with a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.