I have been trying to get an update page to run. I keep getting the "Must declare the scalar variable "@HardwareInventoryID". " Error.
I get this for my select statement from my database. If I replace the Varable name in the select statement with a ? the select will work, but I still get the error when i submit updates.
<%@ Page Language="VB" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:FormView ID="FormView1" runat="server" DataKeyNames="HardwareInventoryID" DataSourceID="SqlDataSource1">
<EditItemTemplate>
HardwareInventoryID:
<asp:Label ID="HardwareInventoryIDLabel1" runat="server" Text='<%# Eval("HardwareInventoryID") %>' />
<br />
Tracking_Num:
<asp:TextBox ID="Tracking_NumTextBox" runat="server" Text='<%# Bind("Tracking_Num") %>' />
<br />
Make:
<asp:TextBox ID="MakeTextBox" runat="server" Text='<%# Bind("Make") %>' />
<br />
Model:
<asp:TextBox ID="ModelTextBox" runat="server" Text='<%# Bind("Model") %>' />
<br />
Description:
<asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>
<ItemTemplate>
HardwareInventoryID:
<asp:Label ID="HardwareInventoryIDLabel" runat="server" Text='<%# Eval("HardwareInventoryID") %>' />
<br />
Tracking_Num:
<asp:Label ID="Tracking_NumLabel" runat="server" Text='<%# Bind("Tracking_Num") %>' />
<br />
Make:
<asp:Label ID="MakeLabel" runat="server" Text='<%# Bind("Make") %>' />
<br />
Model:
<asp:Label ID="ModelLabel" runat="server" Text='<%# Bind("Model") %>' />
<br />
Description:
<asp:Label ID="DescriptionLabel" runat="server" Text='<%# Bind("Description") %>' />
<br />
<asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" />
</ItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:ITInventoryconnectionstring %>"
providerName="<%$ ConnectionStrings:ITInventoryconnectionstring.ProviderName %>"
SelectCommand="SELECT * FROM [Hardware_Inventory] WHERE ([HardwareInventoryID] = @HardwareInventoryID)"
UpdateCommand="UPDATE [Hardware_Inventory] SET [Tracking_Num] = @Tracking_Num, [Make] = @Make, [Model] = @Model, [Description] = @Description, WHERE [HardwareInventoryID] = @HardwareInventoryID">
<SelectParameters>
<asp:QueryStringParameter Name="HardwareInventoryID" QueryStringField="HardwareInventoryID" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Tracking_Num" Type="String" />
<asp:Parameter Name="Make" Type="String" />
<asp:Parameter Name="Model" Type="String" /