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

import

P: n/a
Hi All!

How to import text file into vb.net dataset?

For example a text file with 1000 records as tab delimited text. The text
file contain string, number and date field data. I want to extract the data
between two dates from the text file and bind to the dataset.

How can i do this?

TIA
______________________________

S. Viswanathan
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies

P: n/a
Viswantan,

The most simple way

http://www.windowsformsdatagridhelp....f-212f9e0de193

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
"Viswanathan S" <vi**@ewaksoft.com> schrieb:
How to import text file into vb.net dataset?

For example a text file with 1000 records as tab delimited text.


<URL:http://www.connectionstrings.com/>
-> "Text"

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #3

P: n/a
On Tue, 26 Jul 2005 16:02:11 +0530, "Viswanathan S" <vi**@ewaksoft.com> wrote:

Hi All!

How to import text file into vb.net dataset?

For example a text file with 1000 records as tab delimited text. The text
file contain string, number and date field data. I want to extract the data
between two dates from the text file and bind to the dataset.

How can i do this?

Tab delimited text files require a schema.ini file. It would look something like the following and
is located in the same folder as the text file(s).

[TabDelimitedFile.txt]
ColNameHeader=False
Format=TabDelimited
CharacterSet=ANSI

Code:

Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "E:\My Documents\TextFiles" & ";" & _
"Extended Properties=""Text;HDR=No;"""

Dim TextConnection As New System.Data.OleDb.OleDbConnection(ConnectionString )
TextConnection.Open()

Dim da As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM TabDelimitedFile.txt",
TextConnection)

Dim ds As New DataSet("TextFiles")
da.Fill(ds, "TabDelimited")
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #4

P: n/a
Thanks for all to send the sample codes.

S. Viswanathan
"Viswanathan S" <vi**@ewaksoft.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi All!

How to import text file into vb.net dataset?

For example a text file with 1000 records as tab delimited text. The text
file contain string, number and date field data. I want to extract the data between two dates from the text file and bind to the dataset.

How can i do this?

TIA
______________________________

S. Viswanathan

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.