title: How to add exception handling to SqlDataSource.UpdateCommand
body: <p>We have a radgrid that is automatically updated with the <code>SqlDataSource.UpdateCommand</code>. So when we edit some column(s) and click on "Update" the table is updated correctly with <code>UpdateCommand</code> in the markup.</p>
  
  <p>It looks something like this:</p>
  
  <pre><code>&lt;telerik:RadGrid ID="RadGrid" DataSourceID="SqlDataSource1" runat="server" AllowAutomaticUpdates="true" &gt;
  &lt;MasterTableView AutoGenerateColumns="False" DataKeyNames="City" CommandItemDisplay="Top"  AllowAutomaticUpdates="true"&gt;
          &lt;Columns&gt;
              &lt;telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"&gt;
              &lt;/telerik:GridEditCommandColumn&gt;
              &lt;telerik:GridBoundColumn DataField="City" HeaderText="City" ReadOnly="True" SortExpression="City"
                  UniqueName="City" &gt;
              &lt;/telerik:GridBoundColumn&gt;
              &lt;telerik:GridBoundColumn DataField="Prefix" HeaderText="Prefix" UniqueName="Prefix"&gt;
              &lt;/telerik:GridBoundColumn&gt;
              &lt;telerik:GridBoundColumn DataField="sector" HeaderText="sector" UniqueName="sector"&gt;
              &lt;/telerik:GridBoundColumn&gt;
          &lt;/Columns&gt;
          &lt;/MasterTableView&gt;
  &lt;/telerik:RadGrid&gt;
  &lt;asp:SqlDataSource ID="SqlDataSource1" ConnectionString="&lt;%$ ConnectionStrings:RF-PRConnectionString %&gt;"
  SelectCommand="SELECT STATEMENT" runat="server"
  UpdateCommand= "UPDATE STATEMENT"&gt;
  &lt;UpdateParameters&gt;
      &lt;asp:Parameter Name="Name" Type="String" /&gt;
      &lt;asp:Parameter Name="sector" Type="String" /&gt;
  &lt;/UpdateParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>
  
  <p>But let's say that the update generates an exception in the table (ie. tried to update an Int with varchar, violates some key, etc). Is there any way I can add a <code>Try...Catch</code> to <code>SqlDataSource.UpdateCommand</code>? I wouldn't know how to since there's no code behind that does the update, everything is done through <code>SqlDataSource</code>.</p>