PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Text data provider

Reply

Text data provider

 
Thread Tools Rate Thread
Old 21-05-2004, 12:56 AM   #1
=?Utf-8?B?R3JlZw==?=
Guest
 
Posts: n/a
Default Text data provider


In ODBC and ADO there was the capability to open delimited (tab etc.) text files. Is there the same capability with ADO.NET and can someone point me to some relevant documentation/examples?
  Reply With Quote
Old 21-05-2004, 02:55 AM   #2
William Ryan eMVP
Guest
 
Posts: n/a
Default Re: Text data provider

Check out the Text provider http://www.connectionstrings.com

HTH,

Bill

--
W.G. Ryan MVP Windows - Embedded

www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
"Greg" <anonymous@discussions.microsoft.com> wrote in message
news:2CA13BD0-387B-43B6-9880-6EC8FA36310B@microsoft.com...
> In ODBC and ADO there was the capability to open delimited (tab etc.) text

files. Is there the same capability with ADO.NET and can someone point me to
some relevant documentation/examples?


  Reply With Quote
Old 21-05-2004, 05:16 AM   #3
Val Mazur
Guest
 
Posts: n/a
Default Re: Text data provider

Hi,

Yes, this is the same in .NET, but I would suggest to use OLEDB JET provider
instead of text driver to read from the text files. Here is an example (in
VB6 but idea is the same and connection string will be the same in .NET)

http://support.microsoft.com/defaul...548&Product=ado

--
Val Mazur
Microsoft MVP


"Greg" <anonymous@discussions.microsoft.com> wrote in message
news:2CA13BD0-387B-43B6-9880-6EC8FA36310B@microsoft.com...
> In ODBC and ADO there was the capability to open delimited (tab etc.) text
> files. Is there the same capability with ADO.NET and can someone point me
> to some relevant documentation/examples?



  Reply With Quote
Old 24-05-2004, 09:53 PM   #4
Paul Clement
Guest
 
Posts: n/a
Default Re: Text data provider

On Thu, 20 May 2004 15:56:05 -0700, "Greg" <anonymous@discussions.microsoft.com> wrote:

¤ In ODBC and ADO there was the capability to open delimited (tab etc.) text files. Is there the same capability with ADO.NET and can someone point me to some relevant documentation/examples?

Below is an ADO.NET example using the Jet OLEDB provider:

Dim ConnectionString As String
Dim SQLString As String

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\TextFiles;" & _
"Extended Properties=""Text;HDR=NO;"""

SQLString = "Select * from TextFile.csv"

Dim ConnectionText As New OleDb.OleDbConnection

ConnectionText.ConnectionString = ConnectionString

ConnectionText.Open()

Dim AdapterText As New OleDb.OleDbDataAdapter(SQLString, ConnectionText)

Dim DataSetText As New DataSet("TextFiles")
AdapterText.Fill(DataSetText, "TextFile")

DataGrid1.SetDataBinding(DataSetText, "TextFile")

ConnectionText.Close()


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off