Now, in database 'A' I extract data for fields Name, Age and Status and display on a datagridview - bounded data.
Then I have unbounded field called 'Enabled' which is a checkbox.
So my Datagridview is like;
Name Age Status Enabled
John 35 Active Yes
James 20 Active Yes
Sarah 65 Old No
Yo 53 On Hold No
Julie 70 Active No
Now, this is where it gets interesting - Columns - Name, Age and Status comes from database A and cant be changed/updated - am more interested in the last column "Enabled" which should be saved to a table with the rest of the fields (Name, Age, Status) to database B.
A user can ONLY change the Enabled Flag to Yes/No in the datagridview, all other fields are READONLY.
Now what logic can I perform -
- To have a table in Database B with upto to date data of all the names and there current status + either enabled/disabled.
There should be some sort of Primary key here, in both tables. This would make it easier to link these two tables' relationship with one another. Once that is in place, updating the second table from table a would be a breeze
Clear the rows in B. Loop through the rows in A and add the appropriate information to new rows in B. I assume Enabled already exists in B, set it to 0. In your DGV have the fields all read only except for Enabled. Make sure you BS.EndEdit and TA.Update to B so your changes are saved.