Results 1 to 5 of 5

Thread: [RESOLVED] Read and display using DataGridView?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2012
    Location
    Omaha
    Posts
    17

    Resolved [RESOLVED] Read and display using DataGridView?

    Hello,

    I need to read multiple lines of input, one at a time, and then display the data so that the worker can make sure they entered each batch. The worker will scan in a batch number and that will go to the SQL table to get more information. After that, I have to display this information for them to see. They can't change it at this point but if they missed one, then they can scan it again. How can I read a variable in and then display it to the datagridview. Also, it could be 2 lines or 20 or 50. Is datagridview even the right tool to use?

    I apologize if this matches another thread. I searched and couldn't seem to find anything in this line

    Thanks to everyone for any assistance.
    Last edited by cpeterson36; Oct 29th, 2013 at 11:39 AM. Reason: Update

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,508

    Re: Read and display using DataGridView?

    This is a good place to start to learn how to work with data http://msdn.microsoft.com/en-US/vstu...#formsoverdata

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2012
    Location
    Omaha
    Posts
    17

    Re: Read and display using DataGridView?

    Thanks for the link. It is a good one. I am a DBA but weak in VB.net so I know the data structures but need to know how to specifically do what I asked above. I know I could load the table and then retrieve it and put data into the datagrid view but am concerned about speed. I would like to just be able to grow the datagrid as they scan and then load each item into the table too. Any advice on that?

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

    Re: Read and display using DataGridView?

    Create a DataTable with the appropriate schema, populate it with any initial data from the database, bind it to a BindingSource and bind that to the DataGridView. You can add records via the BindingSource and then save the changes from the DataTable back to the database using a data adapter or table adapter or whatever. The details depend on whether you're using raw ADO.NET, a typed DataSet or some other data access technology.
    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2012
    Location
    Omaha
    Posts
    17

    Re: Read and display using DataGridView?

    Thanks for the help! I am off and running again. Closing this thread!

Tags for this Thread

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