扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
<script runat="server"> Protected Sub EnumerateDictionary(ByVal dictionary As System.Collections.Specialized.IOrderedDictionary) Dim entry As DictionaryEntry For Each entry In dictionary Response.Write(" <b>" & Server.HtmlEncode(entry.Key) & "</b>=" & Server.HtmlEncode(entry.Value) & " (" & Server.HtmlEncode(entry.Value.GetType().Name) & ")<br />") Next End Sub Protected Sub EnumerateCommandParameters(ByVal command As System.Data.Common.DbCommand) Response.Write("<br/>Parameter order in data source...<br />") Dim param As System.Data.Common.DbParameter For Each param In command.Parameters Response.Write(" <b>" & Server.HtmlEncode(param.ParameterName) & "</b>=" & Server.HtmlEncode(param.Value) & " (" & Server.HtmlEncode(param.Value.GetType().Name) & ")<br />") Next End Sub Protected Sub DetailsView1_ItemUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewUpdateEventArgs) Response.Write("<br/>New Values passed from DetailsView...<br />") EnumerateDictionary(e.NewValues) Response.Write("<br/>Keys passed from DetailsView...<br />") EnumerateDictionary(e.Keys) Response.Write("<br/>Old Values passed from DetailsView...<br />") EnumerateDictionary(e.OldValues) End Sub Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) EnumerateCommandParameters(e.Command) e.Cancel = True Response.Write("<br/>Update canceled") End Sub |
<asp:SqlDataSource ConnectionString="<%$ ConnectionStrings:NorthwindOLEDB %>" ID="SqlDataSource1" ProviderName="<%$ ConnectionStrings:NorthwindOLEDB.ProviderName %>" runat="server" SelectCommand="SELECT TOP 10 [OrderID], [OrderDate], [ShipCountry] FROM [Orders]" UpdateCommand="UPDATE [Orders] SET [OrderDate] = ?, [ShipCountry] = ? WHERE [OrderID] = ?" OnUpdating="SqlDataSource1_Updating"> <UpdateParameters> <asp:Parameter Name="OrderDate" Type="DateTime" /> <asp:Parameter Name="ShipCountry" Type="String" /> <asp:Parameter Name="OrderID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者