Results 1 to 2 of 2

Thread: read text file into dataset

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870

    read text file into dataset

    Hi,

    i'm reading a text file into a data set with the code below

    Code:
    strConnection = "Provider=Microsoft.jet.oledb.4.0; data source=c:\; Extended Properties=Text;")
    Dim myConnection as new oledbdConnection(strConnection)
    Dim daInput as new oledbDataAdaapter("select * from textfile.txt", myconnection)
    dim dsInput as new dataset
    daInput.Fill(dsInput)
    It works ok, but it doesn't read the first line of the text file. I pressume it's coz it thinks it's a header, although the file doesn't have one. How do I get it to read the first line in?

    many thanks
    Nick
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  2. #2
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    How are you writing the text file (streamwriter)?

    If you are writing the text file just write some Bulls**t on the first line!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width