I have a datagrid that I have bound to a datatable which was created from a SQL statement such as
SELECT Code, OtherData
FROM CodeTable, OtherDataTable
WHERE CodeTable.Id = OtherDataTable.Id
This all works fine until I wanted to make the grid editable and updatable. Because the data did not come from a single table, the data adapter can't update the data source from the data table.
So basically how do I use 1 table in the sql statement but translate the value of one column (the id) based on information in another table? I did have the dataadapter update code in the CurrentCellChanged event, but I guess another way I could do it is to leave the datagrid bound to the 2 table sql statement and interrogate the datagrid row information in the CurrentCellChanged event and write my own update statement.
Surely there must be an easier way.
Ladyhawk.![[idea] [idea] [idea]](/data/assets/smilies/idea.gif)
** ASP/VB/Java Programmer **
SELECT Code, OtherData
FROM CodeTable, OtherDataTable
WHERE CodeTable.Id = OtherDataTable.Id
This all works fine until I wanted to make the grid editable and updatable. Because the data did not come from a single table, the data adapter can't update the data source from the data table.
So basically how do I use 1 table in the sql statement but translate the value of one column (the id) based on information in another table? I did have the dataadapter update code in the CurrentCellChanged event, but I guess another way I could do it is to leave the datagrid bound to the 2 table sql statement and interrogate the datagrid row information in the CurrentCellChanged event and write my own update statement.
Surely there must be an easier way.
Ladyhawk.
![[idea] [idea] [idea]](/data/assets/smilies/idea.gif)
** ASP/VB/Java Programmer **