By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,698 Members | 1,265 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,698 IT Pros & Developers. It's quick & easy.

how to add csv files in dataset base

P: n/a
Hi

i try to import a .csv file to my dataset base but when i want used
OleDbDataAdapter, i have error.

my connection string :

"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DataSource=c:\somepath\csvfile;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""

Thanks for help
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I think you need a space in Data Source.

--
Joe Fallon

"Bruno" <bo*************@wanadoo.fr> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Hi

i try to import a .csv file to my dataset base but when i want used
OleDbDataAdapter, i have error.

my connection string :

"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DataSource=c:\somepath\csvfile;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""

Thanks for help

Nov 20 '05 #2

P: n/a
of course not, just copy error.
thanks but I have same pb.
"Joe Fallon" <jf******@nospamtwcny.rr.com> a écrit dans le message de
news:%2****************@tk2msftngp13.phx.gbl...
I think you need a space in Data Source.

--
Joe Fallon

"Bruno" <bo*************@wanadoo.fr> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Hi

i try to import a .csv file to my dataset base but when i want used
OleDbDataAdapter, i have error.

my connection string :

"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DataSource=c:\somepath\csvfile;" & _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""

Thanks for help


Nov 20 '05 #3

P: n/a
On Fri, 19 Sep 2003 01:25:36 +0200, "Bruno" <bo*************@wanadoo.fr> wrote:

¤ Hi
¤
¤ i try to import a .csv file to my dataset base but when i want used
¤ OleDbDataAdapter, i have error.
¤
¤ my connection string :
¤
¤ "Provider=Microsoft.Jet.OLEDB.4.0;" & _
¤ "DataSource=c:\somepath\csvfile;" & _
¤ "Extended Properties=""text;HDR=Yes;FMT=Delimited"""
¤

What is the error? In addition, the Data Source should be the path where your csv file is located -
it should not specify the actual file. That is done in your SQL statement.

Dim TextConnectionString As String
TextConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "c:\TestData" & ";" & _
"Extended Properties=""Text;HDR=Yes;FMT=Delimited;"""
Dim TextConn As New System.Data.OleDb.OleDbConnection(TextConnectionSt ring)
TextConn.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from test.csv", TextConn)

Dim ds As DataSet = New DataSet("CSVFiles")
da.Fill(ds, "test.csv")

TextConn.Close()
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.