Hi all,
I'm really stuck here. I've got a GridView on my page and I want to use the update features to-- well, update. Here is my block of code in the SqlDataSource section:
I can open the GridView just fine and I can edit it just fine, but when I do the update, I get the error message: "Must declare variable '@training_unit _name'." and, of course, nothing is stored.
What am I doing wrong? I've been working on this for hours and I keep going in circles. All the documentation I've found indicates this is perfectly legitimate.
Thanks in advance.
Robert Porter
I'm really stuck here. I've got a GridView on my page and I want to use the update features to-- well, update. Here is my block of code in the SqlDataSource section:
Code:
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringTraining %>"
ProviderName="<%$ ConnectionStrings:ConnectionStringTraining.ProviderName %>"
SelectCommand="SELECT training_unit_id, training_unit_name, training_unit_type, training_unit_frequency FROM training_units order by training_unit_name"
UpdateCommand="UPDATE training_units SET training_unit_name = @training_unit_name, training_unit_type = @training_unit_type, training_unit_frequency = @training_unit_frequency WHERE training_unit_id = @training_unit_id">
<UpdateParameters>
<asp:Parameter Name="training_unit_name" Type="String" />
<asp:Parameter Name="training_unit_type" Type="String" />
<asp:Parameter Name="training_unit_frequency" Type="String" />
<asp:Parameter Name="training_unit_id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
What am I doing wrong? I've been working on this for hours and I keep going in circles. All the documentation I've found indicates this is perfectly legitimate.
Thanks in advance.
Robert Porter
Comment