扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
SELECT [ID], [Name], [Address] from [Contacts] -- OverwriteChanges UPDATE [Contacts] SET [Name] = @Name, [Address] = @Address WHERE [ID] = @ID DELETE FROM [Contacts] WHERE [ID] = @ID -- CompareAllValues UPDATE [Contacts] SET [Name] = @Name, [Address] = @Address WHERE [ID] = @original_ID AND [Name] = @original_Name AND [Address] = @original_Address DELETE FROM [Contacts] WHERE [ID] = @original_ID AND [Name] = @original_Name AND [Address] = @original_Address |
<script runat="server"> Protected Sub SqlDataSource1_Updated(sender As Object, e As SqlDataSourceStatusEventArgs) If e.AffectedRows = 0 Then Response.Write("Row changed, update aborted<br />") End If End Sub Protected Sub SqlDataSource1_Deleted(sender As Object, e As SqlDataSourceStatusEventArgs) If e.AffectedRows = 0 Then Response.Write("Row changed, delete aborted<br />") End If End Sub </script> |
<asp:GridView ……> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:TemplateField HeaderText="ContactID" InsertVisible="False" SortExpression="ContactID"> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ContactID") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Eval("ContactID") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ContactName" SortExpression="ContactName"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%# Bind("ContactName") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ContactName") %>'></asp:TextBox> </EditItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者