Monday, 19 August 2013

how to select from two tables, update one table with sqldatasource

how to select from two tables, update one table with sqldatasource

The provider is ODP.net. The data-bound control is GridView with an Edit
button. I got ORA-01008 not all variables bound When I click update
button. The boundfield "NAME" is set to Readonly=True. The data is from
two tables but I only want update one table. Thanks for any reply.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
SelectCommand="SELECT D.ROWID as ROW_ID,D.ID,D.REMARK,M.NAME FROM
PTDIRECT D,PTMASTER M WHERE D.ID=M.ID ORDER BY D.ID"
UpdateCommand="UPDATE PTDIRECT SET ID=:ID,REMARK=:REMARK
WHERE ROWID=:ROW_ID"
OnUpdating="SqlDataSource1_Updating">

No comments:

Post a Comment