how to update a linked table in a gridview?

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top