How do I update One table in a DataGridView that was populated using Two Tables?

Posted on 2008-11-11
Last Modified: 2012-05-05
I have populated a DataGridView using a SQL JOIN SELECT statement pulling data from two tables in the same DataSet. After the end user makes changes in the DataGridView, I need to UPDATE only One of the tables.

What is the most efficient way of handling this?
Question by:TheMidnightToker
    1 Comment
    LVL 4

    Accepted Solution

    If your gridview contains an Id column for the record that you want to update in one particular table then you can write a simple update statement to upddate the record.
    Update table
    set fields = value1
    where Id_field = (IdField from datagridview)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now