Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Method to UPDATE datagridview in a winfrom that's populated by joined tabels

$
0
0

Hi- Newbie here!  I am working on a winform that has a basic datagridview with four columns, three of which are checkbox columns.  It's filled by a dataset and table adapter that is based on a simple join query as follow:

SELECT     dbo.State.StateName, dbo.PharmacyStore_States.Licensed_D, dbo.PharmacyStore_States.Licensed_C, 
dbo.PharmacyStore_States.Licensed_P
FROM       dbo.PharmacyStore_States INNER JOIN
           dbo.State ON 
dbo.PharmacyStore_States.StateCode = dbo.State.StateCode

I'd like to create an UPDATE method for this to save changes back to the database but since this is a join statement that option is not available in the dataset designer. When I use just a straight single table query the option generate the UPDATE method is available and when I debug the form it writes all the changed vales to the database with no problems.

How can I generate or create the proper method to do the UPDATE properly handling multiple row changes?


Viewing all articles
Browse latest Browse all 2535

Trending Articles