472,328 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

import data from csv file

a
Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?
Jul 26 '08 #1
9 5562
On Jul 26, 4:50*am, "a" <a...@a.netwrote:
Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?
ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 26 '08 #2
a
tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g2000h sf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?
ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 27 '08 #3
No one is likely to do that. You haven't specified the problem completely
enough for anyone. For example, are the columns of data well defined or do
you need to determine them at runtime by reading the CSV first? You are
more likely to get an answer if you show where you are stuck in your code.
If you ask for the entire answer without showing your attempt, it will be
more likely for others to think you simply want your homework done for you.

By the way, please don't multipost. There are other answers on
..Dotnet.General where you asked this.

"a" <a@a.netwrote in message
news:O7****************@TK2MSFTNGP02.phx.gbl...
tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g2000h sf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
>Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?

ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 27 '08 #4
First off, community support does not exist to solve your every
problem with no work from you. In general, I will give you (or
whoever) enough guidance to get started on the path to the solution,
but I will not do it for you, otherwise you will never learn. With
that said, I will honor your request and give you the steps you
requested, in a sarcastic tone.

Steps:

1) Buy a book on ADO.NET
2) Apply what you have learned to fix your problem.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 27 '08 #5
by just having a look at the code project web site and searching CSV you can
find what you are looking for
"a" <a@a.netwrote in message news:O7**************@TK2MSFTNGP02.phx.gbl...
tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g2000h sf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
>Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?

ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Jul 28 '08 #6
a
Dear friends

I'm not strong vb.net programmer I'm just take course and I want to learn
from you

And I have Excellent knowledge of access 2003 (Expert)

In access 2003 to import data from CSV file you just select file import and
select text

And all CSV file will import in a new table with some steps with the wizard

know I want just import data from CSV file to Access using VB.NET

by button in vb.net form just click this button the vb.net imports data from
csv file to access mdb file

Mr. Paul

Microsoft MVP (Visual Basic)

give me this code :

Dim AccessConn As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=C:\Test Files\db1 XP.mdb")

AccessConn.Open()

'New table
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT *
INTO [TextFileTable] FROM
[Text;DATABASE=C:\Documents and Settings\...\My Documents\My
Database\Text].[Textfile.txt]",
AccessConn)
'Existing table
'Dim AccessCommand As New System.Data.OleDb.OleDbCommand("INSERT
INTO [TextFileTable] (F1,
F2, F3, F4, F5) SELECT F1, F2, F3, F4, F5 FROM [Text;DATABASE=C:\Documents
and Settings\...\My
Documents\My Database\Text].[Textfile.txt]", AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()

But there is error in the code I can't benefit form this code

The error in sql code

I'm edit this code like this but also there is error in sql code:

Dim cn As New OleDbConnection

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=test.mdb;Persist Security Info=False"

cn.Open()

Dim cmd As New OleDbCommand

cmd.CommandText = ("SELECT * INTO [TextFileTable] FROM [Text;DATABASE=
E:\a.csv]")

cmd.Connection = cn
cmd.ExecuteNonQuery()

cn.Close()

==

Can you edit the code for me







"Gillard" <gillard_georges@@@@@@@@@hotmail.comwrote in message
news:OM**************@TK2MSFTNGP02.phx.gbl...
by just having a look at the code project web site and searching CSV you
can find what you are looking for
"a" <a@a.netwrote in message
news:O7**************@TK2MSFTNGP02.phx.gbl...
>tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g2000 hsf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
>>Dear friends

I want import data from CSV file to mdb file How can I do that in
vb.net?

ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/

Jul 28 '08 #7
a,

It is important that you tell us if you want to use an import in an existing
database or a new database table.

As you are an expert in Access, you would no the reason.

That there is nothing simple is probably because that Jet is a little bit
out of the focus and everything is now SQL Server, where is a simple
BulkCopy (Although I see that this will be replaced)

For OleDB you have in fact simple to get a DataSet using the connection and
the Fill from CSV and then use that DataSet by looping through the resulted
datatable and then update your database that you have filled first.

For the update you can simple use the commandbuilder.

Cor

"a" <a@a.netschreef in bericht
news:ed**************@TK2MSFTNGP03.phx.gbl...
Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?


Jul 28 '08 #8
no = know

Sorry

Cor
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:On**************@TK2MSFTNGP02.phx.gbl...
a,

It is important that you tell us if you want to use an import in an
existing database or a new database table.

As you are an expert in Access, you would no the reason.

That there is nothing simple is probably because that Jet is a little bit
out of the focus and everything is now SQL Server, where is a simple
BulkCopy (Although I see that this will be replaced)

For OleDB you have in fact simple to get a DataSet using the connection
and the Fill from CSV and then use that DataSet by looping through the
resulted datatable and then update your database that you have filled
first.

For the update you can simple use the commandbuilder.

Cor

"a" <a@a.netschreef in bericht
news:ed**************@TK2MSFTNGP03.phx.gbl...
>Dear friends

I want import data from CSV file to mdb file How can I do that in vb.net?


Jul 28 '08 #9
Your best course of action is to research the task at hand using Google. My
approach would be to discover how to read the CSV file into a collection
which can be looped though for data correctness then when this is done use
OleDb components to store the data.

The best advice after searching and reading MSDN documentation is to ask
your question here supplement your question with snippets of code so the
experts here can assist you.

Why not break down the objective as follows; read a text file line by line
i.e. System.IO.StreamReader, Loop thru this data, parse the data perhaps
using Regular expressions followed by validating and pushing the data to the
Access database using OleDb components.

Good luck :-)

"a" <a@a.netwrote in message news:u6**************@TK2MSFTNGP04.phx.gbl...
Dear friends

I'm not strong vb.net programmer I'm just take course and I want to learn
from you

And I have Excellent knowledge of access 2003 (Expert)

In access 2003 to import data from CSV file you just select file import
and select text

And all CSV file will import in a new table with some steps with the
wizard

know I want just import data from CSV file to Access using VB.NET

by button in vb.net form just click this button the vb.net imports data
from csv file to access mdb file

Mr. Paul

Microsoft MVP (Visual Basic)

give me this code :

Dim AccessConn As New
System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=C:\Test Files\db1 XP.mdb")

AccessConn.Open()

'New table
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT *
INTO [TextFileTable] FROM
[Text;DATABASE=C:\Documents and Settings\...\My Documents\My
Database\Text].[Textfile.txt]",
AccessConn)
'Existing table
'Dim AccessCommand As New System.Data.OleDb.OleDbCommand("INSERT
INTO [TextFileTable] (F1,
F2, F3, F4, F5) SELECT F1, F2, F3, F4, F5 FROM
[Text;DATABASE=C:\Documents and Settings\...\My
Documents\My Database\Text].[Textfile.txt]", AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()

But there is error in the code I can't benefit form this code

The error in sql code

I'm edit this code like this but also there is error in sql code:

Dim cn As New OleDbConnection

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=test.mdb;Persist Security Info=False"

cn.Open()

Dim cmd As New OleDbCommand

cmd.CommandText = ("SELECT * INTO [TextFileTable] FROM [Text;DATABASE=
E:\a.csv]")

cmd.Connection = cn
cmd.ExecuteNonQuery()

cn.Close()

==

Can you edit the code for me







"Gillard" <gillard_georges@@@@@@@@@hotmail.comwrote in message
news:OM**************@TK2MSFTNGP02.phx.gbl...
>by just having a look at the code project web site and searching CSV you
can find what you are looking for
"a" <a@a.netwrote in message
news:O7**************@TK2MSFTNGP02.phx.gbl...
>>tell me the steps (the answer)
Thank you
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:00**********************************@34g200 0hsf.googlegroups.com...
On Jul 26, 4:50 am, "a" <a...@a.netwrote:
Dear friends

I want import data from CSV file to mdb file How can I do that in
vb.net?

ADO.NET

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/


Jul 28 '08 #10

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

Similar topics

2
by: David Berry | last post by:
Hi All. I'm looking for any help or sample code that can show me how to make a file import wizard in ASP.NET (VB preferred) like the one that MS...
3
by: Anthony Robinson | last post by:
I have an issue I've been working on that has proven to be quite troublesome. I already have an idea of what the anwser may be, but would like to...
1
by: DCM Fan | last post by:
Access 2K, SP3 on Windows 2K, SP4 All, I have an import spec set up with quoted Identifiers and comma-separated values. The text file is...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous...
3
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from...
4
by: Bruce W. Roeser | last post by:
All, I'm reading a book by Charles Petzold (Programming VS.Net). Pretty good content but am confused about the difference. From the text: ...
3
by: Chris | last post by:
Hi, 1) In file test.aspx, i put: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> <%@ import...
10
by: nisp | last post by:
Hi all ! I'm trying to capture stderr of an external module I use in my python program. I'm doing this by setting up a class in my module...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.