473,396 Members | 2,010 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,396 software developers and data experts.

accessing CSV files through C# and ADO.NET

Hi

Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so far,
I have found no mention of how to do this.

Any help/sample code would be appreciated

Tnx

Paul BJ
Nov 16 '05 #1
5 6127
On Sat, 12 Jun 2004 23:24:36 +0200, Paulos wrote:
Hi

Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so far,
I have found no mention of how to do this.

Any help/sample code would be appreciated

Tnx

Paul BJ


I have no experience actually doing this - so I can't attest to the quality
of the library... But, you might want to check the SharpCvsLib over at
http://www.icsharpcode.net.

--
Tom Shelton [MVP]
Nov 16 '05 #2
SP
Look at the StreamReader class.

SP

"Paulos" <pa*************@skynet.be> wrote in message
news:40**********************@news.skynet.be...
Hi

Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so far, I have found no mention of how to do this.

Any help/sample code would be appreciated

Tnx

Paul BJ

Nov 16 '05 #3
Paulos wrote:
Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so far,
I have found no mention of how to do this.

Any help/sample code would be appreciated


You could use the ODBC Driver for Text:
http://www.able-consulting.com/MDAC/...CDriverForText

or you can also open a Text file using the JET OLE DB Provider:
http://www.able-consulting.com/MDAC/...crosoftJetText

Cheers

Arne Janning
Nov 16 '05 #4
Sorry I should have been more specific....

What I need to do is to open the CSV files (comma delimited text files) as
what used to be called recordsets in ADO. I then need to manipulate the data
and insert the it into a SQL Server DB.
"Paulos" <pa*************@skynet.be> wrote in message
news:40**********************@news.skynet.be...
Hi

Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so far, I have found no mention of how to do this.

Any help/sample code would be appreciated

Tnx

Paul BJ

Nov 16 '05 #5
You might want to search the Gotdotnet.com user samples area for Chris
Lovett's XMLCSVREADER implementation.
This will allow you to read and convert a CSV text file into an XmlDocument,
and this can then be easily loaded into a DataSet using the ReadXml method.
--Peter

"Paulos" <pa*************@skynet.be> wrote in message
news:40**********************@news.skynet.be...
Sorry I should have been more specific....

What I need to do is to open the CSV files (comma delimited text files) as
what used to be called recordsets in ADO. I then need to manipulate the
data
and insert the it into a SQL Server DB.
"Paulos" <pa*************@skynet.be> wrote in message
news:40**********************@news.skynet.be...
Hi

Has anyone any experience of accessing .CSV files with ADO.NET and C#?

All I want to do is open and read a number of them.

I have search the help files, the MDSN and all the books I have but so

far,
I have found no mention of how to do this.

Any help/sample code would be appreciated

Tnx

Paul BJ


Nov 16 '05 #6

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

Similar topics

36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
3
by: Gerhard | last post by:
I have an application that needs to be able to upload documents that can latter be accessed and opened by a hyperlink. I can do this easliy if I store the files in a subdirectory in the...
3
by: kosmodisk | last post by:
Hi, I'm having problem accessing javascript-created elements from opened window. This occurs only when I'm including another files in opened window, javascript or css. When I comment out...
1
by: leenadiwan | last post by:
Friends, Im having problem with accessing a JS file placed in another folder from a JSP popup. I tried all the following: <SCRIPT LANGUAGE="JavaScript1.1" ...
6
by: Adam McCormack | last post by:
Good morning, I hope I'm not repeating a post, but I did try to search for the topic before asking. I am trying to resolve an issue that has come up as a result of planned migration from a single...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.