HeavenCore
Well-known member
Hi.
I have a DataGrid which displays data from a table adapter. The table adapter uses a JOIN statement (see query and example datagrid at end of post) to join 3 tables on foreign keys, the data grid view also has two columns which are data bound allowing users to select different foreign keys etc.
Obviously though this has one big issue, because the datagrid is bound to a join table it does not allow updates.
I used a join so i could look at the foreign keys and populate the combo boxes with User friendly values from the related tables. How do i get this working?
Regards
Jordon
Join Query:
I have a DataGrid which displays data from a table adapter. The table adapter uses a JOIN statement (see query and example datagrid at end of post) to join 3 tables on foreign keys, the data grid view also has two columns which are data bound allowing users to select different foreign keys etc.
Obviously though this has one big issue, because the datagrid is bound to a join table it does not allow updates.
I used a join so i could look at the foreign keys and populate the combo boxes with User friendly values from the related tables. How do i get this working?
Regards
Jordon
Join Query:
VB.NET:
SELECT tblJobs.JobDatabaseID, tblJobs.JobNumber, tblPlants.PlantID, tblPlants.PlantGroup_fk, tblPlants.PlantCode, tblPlants.PlantSerialNumber,
tblPlants.PlantValue, tblPlants.PlantSold, tblPlants.PlantOnJob, tblPlants.PlantOnJob_fk, tblPlants.PlantMonths, tblPlants.PlantServiceDueDay,
tblPlants.PlantDefaultCost, tblPlantGroups.PlantGroupID, tblPlantGroups.PlantGroupName
FROM tblPlants INNER JOIN
tblPlantGroups ON tblPlants.PlantGroup_fk = tblPlantGroups.PlantGroupID LEFT OUTER JOIN
tblJobs ON tblPlants.PlantOnJob_fk = tblJobs.JobDatabaseID