Note: The update portion of the following code segment was hard coded by myself and not generated code from VS. I couldn't figure out how to get VS to generate the update so I looked up a solution online.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:harrison8786ConnectionString %>"
ProviderName="<%$ ConnectionStrings:harrison8786ConnectionString.ProviderName %>"
SelectCommand="SELECT COFFEE_SKU, COFFEE_NAME, COFFEE_DETAILS, coffee_price FROM coffee"
UpdateCommand="UPDATE coffee SET @Field=@NewValue WHERE COFFEE_SKU=@SKU">
<UpdateParameters>
<asp:ControlParameter Name="Field" ControlId="ddlField" PropertyName="SelectedValue"/>
<asp:ControlParameter Name="NewValue" ControlId="txtNewValue" PropertyName="Text"/>
<asp:ControlParameter Name="SKU" ControlId="ddlCoffeeNames" PropertyName="SelectedValue"/>
</UpdateParameters>
</asp:SqlDataSource>


Sign In
Create Account


Back to top









