Results 1 to 2 of 2

Thread: DataGridView Bind to Text File

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fox, OK
    Posts
    381

    DataGridView Bind to Text File

    Is it possible to bind a DataGridView to a text file?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: DataGridView Bind to Text File

    Yes and no. It's certainly not possible to actually bind the grid to the file itself. You would need to read the file into some data structure that implements the IList interface, which is required for data-binding. You might use ADO.NET to read the file contents into a DataTable and bind that, or you might use a TextFieldParser to read the file into objects of your own and put those in an array or collection and then bind that.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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