Populating a dataset using text files RRS feed

  • Question

  • I'm looking to populate a dataset from data within text files.  The data is delimited by a new line.  Does anyone have experience or information looking to bring the informatio to it, please let me know!!!!!!!


    Overall, I'm going to import the information into an MS Access database.  If anyone has a better/easier way to accomplish this I would truly appreciate it. 


    Thanks in advance!!!!!!

    Friday, August 31, 2007 8:03 PM

All replies

  • So, does your SIG mean you have a degree in Information Technology or that you're working on a graduate degree? Wink


    There are fundamentally two approaches you can take. First, you can write your own data handler that uses (language appropriate) Read statements to read and parse the data from the Text file. This is really easy to do in Visual Basic--harder in C# or other newer languages.

    Next, you can use the ODBC Text Data Source driver approach. Here you build a DSN that addresses the file, chooses the parsing options (I hope the columns are delimited with commas, tabs, quotes or a special character), and how the rows are to be handled. In this case you can use ADO or ADO.NET to open the TextFile and input the rows into a suitable Recordset or DataTable or simply build INSERT statements that post the rows to the JET database.


    You might also investigate SSIS/DTS/BulkCopy which can do this for you.



    Friday, August 31, 2007 9:25 PM
  • First, a degree in Information Tech.  lol


    Do you know of any sites that can explicitly so this in detail?


    I'm completely new at this.  Currently I have the information in text form. I know how to read it to variables.  Though, I have NO IDEA how to connect to the database in order to import this information.  If you could provide me with some ADO or ADO.NET sites (i'm currently using VB .Net 2003) I would greatly appreciate it.


    Tuesday, September 4, 2007 6:19 PM
  • Can you post a few lines from your text file?


    Wednesday, September 5, 2007 12:30 PM
  • Date
    Update person


    AS400 Revision

    part number










    Each file is a different part number.  I have over 12,000 part numbers.  Currently I'm researching how to get the each file into a dataset format in order to bring the dataset into an access database.


    I'm having trouble understanding the connections and dataset creation along with the implementation of tying all this in with an existing (but empty) database.


    Thanks in advance!!!

    • Proposed as answer by AnaguaSoft Tuesday, December 28, 2010 7:56 AM
    Wednesday, September 5, 2007 2:05 PM
  • You do populate your dataset by


    1. creating a filereader with its readline() method then set its delimeter according to what is available in your text file.

    2. pass all text that has been read by your file reader to a List View.

    3. Save all text file to your database table.

    4. Re-create the dataset and refill it.


    I think you are trying to create a data import form for you textfile to a database.





    Anatoly Guaniezo
    • Proposed as answer by AnaguaSoft Tuesday, December 28, 2010 8:01 AM
    Tuesday, December 28, 2010 8:01 AM