473,394 Members | 1,752 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,394 software developers and data experts.

Problem on reading .csv files using OleDbConnection

Ray
Hi All

I've tried to read a .csv file and bind the data to a datagrid.
I am doing sth like this:

conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; "+
"Data Source=" + csvPath + ";" +
"Extended Properties=\"text;HDR=YES;FMT=Delimited\"");
conn.Open();
//Read all data into a data table
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM ["+csvPath+"]", conn);

But I discover that some of data can not be retrieved (while I can retrieve most of them).
Then when I tried to add a link break (simply pressing Enter) @ the line above the line containing unretrieved value in the text editor, I will get things all right.

I guess it is sth to do with the carriage return encoding in the CSV (CSV provided by the others), so that the conn can't recognize the string, how can I fix that?

Thanks

Ray
Jan 19 '06 #1
0 1615

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

Similar topics

4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
4
by: Michael C# | last post by:
Hi all, I have a little program that uses OleDb to open and read an Excel spreadsheet from VB.NET. The problem I'm running into is it's not reading the column headers... The Excel worksheet...
0
by: Ramakrishnan Nagarajan | last post by:
Hi, I am facing a problem in uploading Excel data to the Database. While uploading my code reads Excel Data using OleDbReader and store into a dataset by looping through the OleDbReader result...
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...
1
by: Chris Yan | last post by:
Hi All I have an excel sheet with Chinese characters in them. I'm using the OLEBE 4.0 Jet Driver in C# Microsoft Visual Studio 2005 to read from the Excel sheet and then enter into mySQL...
8
by: matt | last post by:
hello, can anyone speak to some of the common or preferred methods for building Excel .XLS files, programmatically thru the .NET framework? i have an intranet app that needs to generate &...
6
by: Bill Nguyen | last post by:
I'm reading a CSV file with the date colum formatted as "YYMMDD" -"070310" when viewed in notepad or similar trext editor. However, in my app, using ODBCReader, the column value becomes "70310"...
0
by: aloneball | last post by:
I have several Excel files which I need to import into a SQL server. I open each file using string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source = " + fileName +...
2
by: tshad | last post by:
I have a program that is reading a csv file into a dataset. I want it to read the 1st line as data. But it ignores it. I have the Connection set up as: OleDbConnection csvConnection = new...
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
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?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.