Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UPDATE dbo.tblHardware SET TypeID = @TypeID, Name = @Name, Description = @Description, Cost = @Cost, Weight = @Weight, Image = @Image WHERE (HardwareID = @HardwareID)
- <asp:SqlDataSource ID="dsHardware" runat="server"
- ConnectionString="<%$ ConnectionStrings:RequestFormsConnectionString %>"
- OldValuesParameterFormatString="original_{0}"
- SelectCommand="SELECT * FROM [vHardware]"
- UpdateCommand="UPDATE dbo.tblHardware SET TypeID = @TypeID, Name = @Name, Description = @Description, Cost = @Cost, Weight = @Weight, Image = @Image WHERE (HardwareID = @HardwareID)"
- InsertCommand="INSERT INTO [vHardware] ([HardwareID], [TypeID], [Description], [Name], [Cost], [Weight], [Image], [TypeDesc], [TypeName], [TypeTypeID]) VALUES (@HardwareID, @TypeID, @Description, @Name, @Cost, @Weight, @Image, @TypeDesc, @TypeName, @TypeTypeID)"
- DeleteCommand="DELETE From tblHardware WHERE HardwareID = @HardwareID">
- <UpdateParameters>
- <asp:FormParameter FormField="TypeID" Name="TypeID" />
- <asp:FormParameter FormField="Name" Name="Name" />
- <asp:FormParameter FormField="Description" Name="Description" />
- <asp:FormParameter FormField="Cost" Name="Cost" />
- <asp:FormParameter FormField="Weight" Name="Weight" />
- <asp:FormParameter FormField="Image" Name="Image" />
- <asp:FormParameter FormField="HardwareID" Name="HardwareID" />
- </UpdateParameters>
- <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
- AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" DataKeyNames="HardwareID,TypeTypeID"
- DataSourceID="dsHardware">
- <Columns>
- <asp:BoundField DataField="HardwareID" HeaderText="HardwareID" InsertVisible="False"
- ReadOnly="True" SortExpression="HardwareID" />
- <asp:BoundField DataField="TypeID" HeaderText="TypeID" SortExpression="TypeID" />
- <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
- <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
- <asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" />
- <asp:BoundField DataField="Weight" HeaderText="Weight" SortExpression="Weight" />
- <asp:BoundField DataField="Image" HeaderText="Image" SortExpression="Image" />
- <asp:BoundField DataField="TypeDesc" HeaderText="TypeDesc" SortExpression="TypeDesc" />
- <asp:BoundField DataField="TypeName" HeaderText="TypeName" SortExpression="TypeName" />
- <asp:BoundField DataField="TypeTypeID" HeaderText="TypeTypeID" InsertVisible="False"
- ReadOnly="True" SortExpression="TypeTypeID" />
- </Columns>
- </asp:GridView>
- <asp:ControlParameter> should help you out.
- <asp:ControlParameter ControlID="GridView1" Name="HardwareID"
- PropertyName="SelectedValue" Type="Int32" />
- OldValuesParameterFormatString="original_{0}"
Add Comment
Please, Sign In to add comment