D
Dan
Hi,
I made two gridviews.
Each gridview is linked to a table. The tables are linked together (primary
key and foreign key).
When clicking on the 'Selectbutton' in the first gridview, the second
gridview appears with the records matching the selected value of the first
gridview.
I can update and delete records of the first gridview. I can delete records
of the second gridview but not update (when making changes and clicking on
'Update', no error appears but no changes are made.
My question is: is it possible, and if yes, what 'm doing wrong?
I show the code of the second gridview:
<asp:AccessDataSource ID="AccessDataSource2" runat="server"
DataFile="~/App_Data/newres.mdb"
SelectCommand="SELECT [keyfield], [fld2], [fld3] FROM [mytable] WHERE
([foreignkey] = ?)"
UpdateCommand="Update [mytable] set [fld2]=?,[fld3]=? where [keyfield] = ?">
<SelectParameters>
<asp:ControlParameter
ControlID="GridView1"
Name="lokaal" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:AccessDataSource>
I made two gridviews.
Each gridview is linked to a table. The tables are linked together (primary
key and foreign key).
When clicking on the 'Selectbutton' in the first gridview, the second
gridview appears with the records matching the selected value of the first
gridview.
I can update and delete records of the first gridview. I can delete records
of the second gridview but not update (when making changes and clicking on
'Update', no error appears but no changes are made.
My question is: is it possible, and if yes, what 'm doing wrong?
I show the code of the second gridview:
<asp:AccessDataSource ID="AccessDataSource2" runat="server"
DataFile="~/App_Data/newres.mdb"
SelectCommand="SELECT [keyfield], [fld2], [fld3] FROM [mytable] WHERE
([foreignkey] = ?)"
UpdateCommand="Update [mytable] set [fld2]=?,[fld3]=? where [keyfield] = ?">
<SelectParameters>
<asp:ControlParameter
ControlID="GridView1"
Name="lokaal" PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:AccessDataSource>