Insert from DataGridView


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Insert from DataGridView

  1. #1
    Join Date
    Apr 2004
    Posts
    134

    Insert from DataGridView

    Hi,

    Could anybody give me some example code to insert rows of datagridview into a sql express database table? Also, how do I manage concurrency as it is a multi user application?

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Apr 2004
    Posts
    134
    Sorry, that didn't help.

    Thanks

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Can you be more specific? Why didn't it help? What problem are you having?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Apr 2004
    Posts
    134
    I have 3 database tables, of which two contains data and one named 'Details' is exclusively for data entry by the user. In the GUI created by VB.NET, I have a datagridview control and a couple of text boxes and comboboxs. The user fills in these controls including the datagridview. After data entry, the user clicks on a button to submit these records to the Details table. I would like to know how to code in the submit button.

    Thanks
    Last edited by shers; 03-04-2009 at 05:14 AM.

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Couldn't you simply UPDATE the existing record in the database based on the textboxes and combo boxes, then clear and reload your grid so those changes would be reflected for display.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    Apr 2004
    Posts
    134
    The records in the datagridview contains more fields than the other existing tables. So I have created a table only for storing user data. The other two tables are only for retrieving certain values like Unit Cost and Project No.

    Thanks

Similar Threads

  1. SQL Help
    By carbon_13 in forum Database
    Replies: 14
    Last Post: 03-14-2008, 04:03 PM
  2. Replies: 18
    Last Post: 12-13-2006, 02:49 PM
  3. Having issues with BULK INSERT, please advise...
    By Tony Fountain in forum Database
    Replies: 4
    Last Post: 02-04-2003, 04:30 PM
  4. INSERT for multiple tables with IDENTITY
    By Kay in forum Database
    Replies: 1
    Last Post: 07-04-2001, 05:18 AM
  5. SQL Tutorial (Answer Q's & post your reply)
    By bigbastard4 in forum Database
    Replies: 2
    Last Post: 05-16-2001, 06:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center