<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 |