FormView显示、更新、插入、删除数据库操作[ASP.NET源代码](三)(5)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:15 点击:次
<td height="30" width="60">
</td>
<td height="30" width="120" align="right">
<asp:Button ID="btnInsert" Text="插入" CommandName="Insert" runat="server" /></td>
<td height="30" width="60">
<asp:Button ID="btnCancel" Text="取消" CommandName="Cancel" runat="server" /></td>
</tr>
</table>
</InsertItemTemplate>
</asp:FormView>
<asp:SqlDataSource ID="sdsItem" runat="server" ConnectionString="<%$ ConnectionStrings:NetShopConnString %>"
SelectCommand="SELECT Item.ItemId AS ItemId,Item.CategoryId AS CategoryId,Item.Name AS Name,Item.Price AS Price,Item.Image AS Image,Category.Name As CategoryName FROM Item INNER JOIN Category ON Item.CategoryId=Category.CategoryId"
UpdateCommand="UPDATE Item SET CategoryId=@CategoryId,Name=@Name,Price=@Price,Image=@Image WHERE ItemId=@ItemId"
InsertCommand="INSERT INTO Item(CategoryId,Name,Price,Image) VALUES (@CategoryId,@Name,@Price,@Image)">
<UpdateParameters>
<asp:Parameter Name="CategoryId" />
<asp:Parameter Name="Name" />
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>