I am using ASP.NET and using a grid with the UpdateCommand to update 2 tables
I have the following but doesn’t seem to work as I do not get any errors but it simply does not update. From what you can see, am I on the right track?
UpdateCommand="UPDATE [tbl_ProgDt] SET [Type] = @type, [Identifiction] = @samplePoint WHERE [Seq] = @valID UPDATE [tbl_Prog] SET StoreNum = @storeNum WHERE ID = (SELECT ID FROM [tbl_ProgDt] WHERE [Seq] = @valID " >
<UpdateParameters>
<asp:Parameter Name="type" Type="String" />
<asp:Parameter Name="samplePoint" Type="String" />
<asp:Parameter Name="valID" Type="Int32" />
<asp:Parameter Name="storeNum" Type="Int32" />
<asp:Parameter Name="valID" Type="Int32" />
</UpdateParameters>
If you need to do something like that, it would be better to create a stored procedure and wrap the two update sentences using a database transaction
You need to specify:
In your Stored Procedure, something like this: