<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Dynamic Data</title><link>http://forums.asp.net/1145.aspx</link><description>Discussions regarding the new scaffolding framework in ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2804913.aspx</link><pubDate>Fri, 12 Dec 2008 17:00:01 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2804913</guid><dc:creator>Yitzhak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2804913.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2804913</wfw:commentRss><description>&lt;p&gt;Just to finalize&amp;nbsp;this very long &amp;nbsp;post.&lt;/p&gt;
&lt;p&gt;The solution provided by David Ebbo is exactly what the doctor ordered. &lt;/p&gt;
&lt;p&gt;I am very thankful to all the participants who contributed to this&amp;nbsp;post on the forum.&lt;br /&gt;It provided an important insight how to handle exceptions coming out of the database.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards, &lt;br /&gt;Yitzhak &lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802731.aspx</link><pubDate>Thu, 11 Dec 2008 23:04:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802731</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802731.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802731</wfw:commentRss><description>&lt;p&gt;FYI, I just wrote a &lt;a class="" href="http://blogs.msdn.com/davidebb/archive/2008/12/11/handling-database-exceptions-in-dynamic-data.aspx"&gt;blog post&lt;/a&gt; on this issue, with a complete sample attached.&lt;/p&gt;
&lt;p&gt;thanks,&lt;br /&gt;David&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802724.aspx</link><pubDate>Thu, 11 Dec 2008 23:00:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802724</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802724.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802724</wfw:commentRss><description>If you don&amp;#39;t delete&amp;nbsp; &lt;font color="#ff0000"&gt;&lt;font color="#ff0000"&gt;CausesValidation&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;&lt;font color="#0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="+0"&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;From&amp;nbsp; List.aspx (and ListDetails if you&amp;#39;re using it)&amp;nbsp; - you get a less than helpful message A Runtime Error has occurred.&lt;br /&gt;Do you wish to Debug?&amp;nbsp;&amp;nbsp; Line: 4723&lt;br /&gt;Error: Sys.WebForms.PageRequestManagerServerErrorException: An error occurred while updating the entries. See the InnerException for details. 
&lt;p&gt;After deleting&amp;nbsp; , on AdventureWorks light I tried to delete a product description (that is referenced in the product table and has a constraint). I get the following nice Validation error message:&lt;/p&gt;&lt;font color="red"&gt;List of validation errors 
&lt;ul&gt;
&lt;li&gt;The DELETE statement conflicted with the REFERENCE constraint &amp;quot;FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID&amp;quot;. The conflict occurred in database &amp;quot;AdventureWorksLT2008&amp;quot;, table &amp;quot;SalesLT.ProductModelProductDescription&amp;quot;, column &amp;#39;ProductDescriptionID&amp;#39;. The statement has been terminated.&lt;/li&gt;&lt;/ul&gt;&lt;/font&gt;Yitzhak - ping me offline if you&amp;#39;re still having problems.&lt;/font&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802621.aspx</link><pubDate>Thu, 11 Dec 2008 21:52:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802621</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802621.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802621</wfw:commentRss><description>&lt;p&gt;Hi Yitzhak,&lt;/p&gt;
&lt;p&gt;I think I know why this is not quite working for you.&amp;nbsp; There is another small issue that has come up before in the forum and is easy to fix: in List.aspx and Details.aspx, you&amp;#39;ll find a CausesValidation=&amp;quot;false&amp;quot;.&amp;nbsp; Delete it (or set it to true), and I think it&amp;#39;ll all work for you.&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802559.aspx</link><pubDate>Thu, 11 Dec 2008 21:24:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802559</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802559.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802559</wfw:commentRss><description>&lt;p&gt;Hi Yitzhak,&lt;/p&gt;
&lt;p&gt;You really should turn off partial rendering while trying to get to the bottom of this issue, as it masks the real errors.&amp;nbsp; Have you tried debugging into ValidateException() to see whether it gets to the line that creates the ValidationException?&amp;nbsp; This works fine for me.&amp;nbsp; The scenario I tested was:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;DD app using Entity Framework&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a Northwind model&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Try to delete a category, which causes a DB error because of contraint violations&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;With code above, I get the error to show up in the page validation summary.&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802407.aspx</link><pubDate>Thu, 11 Dec 2008 19:54:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802407</guid><dc:creator>Yitzhak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802407.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802407</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hi David,&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Some progress on my side.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;The addition of the empty constructor to the MyDynamicValidator class did the trick.&lt;br /&gt;The code inside ValidateException() is executing now.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;So far I see 2 open issues:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="MARGIN:0in 0in 0pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri" size="3"&gt;1.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;The error message is displayed in the message box in the browser, not through the &lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;same execution path as a built-in Dynamic Data attribute based validation. This was the original intent.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="MARGIN:0in 0in 10pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri" size="3"&gt;2.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;The actual &lt;/span&gt;error message in the message box in the browser still doesn’t show &lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;the &lt;/font&gt;&lt;/font&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;exception.InnerException.&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;It seems that the code manipulating with exceptions inside ValidateException() should be tweaked.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Below is the message I am getting in the message box of the Internet Explorer:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;---------------------------&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Error&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;---------------------------&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;A Runtime Error has occurred.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Do you wish to Debug?&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Line: 4723&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Error: Sys.WebForms.PageRequestManagerServerErrorException: An error occurred while updating the entries. See the InnerException for details.&lt;/font&gt;&lt;/p&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Regards,&lt;br /&gt;Yitzhak&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802394.aspx</link><pubDate>Thu, 11 Dec 2008 19:50:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802394</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802394.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802394</wfw:commentRss><description>&lt;p&gt;Why not trap the exception in a global error handler, parse the error message (so you have a good idea of what went wrong) - then redirect to the previous page and post an intelligent error message. (This row cannot be deleted until dependant rows are deleted) - That was what I meant when I originally said Setting &lt;a class="" href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.enablepartialrendering.aspx"&gt;&lt;font color="#5403fa"&gt;EnablePartialRendering&lt;/font&gt;&lt;/a&gt;&amp;nbsp;in not only for debug/dev. Brad tells me even with&amp;nbsp; &lt;a class="" href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.enablepartialrendering.aspx"&gt;&lt;font color="#5403fa"&gt;EnablePartialRendering&lt;/font&gt;&lt;/a&gt;&amp;nbsp;set to true, you can do a redirect and get the error message.&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802311.aspx</link><pubDate>Thu, 11 Dec 2008 19:19:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802311</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802311.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802311</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m a bit confused here.&amp;nbsp; If you get a null ref exception in the javascript error, then you should still get a null ref exception when you turn off partial rendering.&amp;nbsp; It should just be displayed with a full stack trace.&lt;/p&gt;
&lt;p&gt;Misc things to try:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div&gt;Add a constructor to MyDynamicValidator and see if it gets there&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Change the config registration to a bad class name (e.g. mappedTagType=&amp;quot;&lt;strong&gt;Bad&lt;/strong&gt;DynamicValidator&amp;quot;) and make sure that it complains.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802221.aspx</link><pubDate>Thu, 11 Dec 2008 18:41:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802221</guid><dc:creator>Yitzhak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802221.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802221</wfw:commentRss><description>&lt;p&gt;I am calling the Dynamic Data without stored procedures, i.e as is, directly.&lt;br /&gt;The original idea was and still is to redirect the app. flow through the Dynamic Data native flow for the client side validation error path.&lt;/p&gt;
&lt;p&gt;Here is the error info:&lt;/p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;
&lt;h1&gt;Server Error in &amp;#39;/LM_BuildingMaintenance&amp;#39; Application. 
&lt;hr /&gt;
&lt;/h1&gt;
&lt;h2&gt;&lt;i&gt;The DELETE statement conflicted with the REFERENCE constraint &amp;quot;FK_Fee_FeeCategory&amp;quot;. The conflict occurred in database &amp;quot;LM_Building&amp;quot;, table &amp;quot;dbo.Fee&amp;quot;, column &amp;#39;FeeCategoryID&amp;#39;.&lt;br /&gt;The statement has been terminated.&lt;/i&gt; &lt;/h2&gt;
&lt;p&gt;&lt;/span&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: &lt;/b&gt;An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Exception Details: &lt;/b&gt;System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint &amp;quot;FK_Fee_FeeCategory&amp;quot;. The conflict occurred in database &amp;quot;LM_Building&amp;quot;, table &amp;quot;dbo.Fee&amp;quot;, column &amp;#39;FeeCategoryID&amp;#39;.&lt;br /&gt;The statement has been terminated.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table class="" bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;code&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.&lt;/code&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;&lt;font face="Verdana"&gt;Stack Trace:&lt;/font&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table class="" bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;code&gt;&lt;pre&gt;[SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint &amp;quot;FK_Fee_FeeCategory&amp;quot;. The conflict occurred in database &amp;quot;LM_Building&amp;quot;, table &amp;quot;dbo.Fee&amp;quot;, column &amp;#39;FeeCategoryID&amp;#39;.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +204
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +175
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
   System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues) +554
   System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) +253

[UpdateException: An error occurred while updating the entries. See the InnerException for details.]
   System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) +442
   System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache) +117
   System.Data.Objects.ObjectContext.SaveChanges(Boolean acceptChangesDuringSave) +453
   System.Data.Objects.ObjectContext.SaveChanges() +9
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +624
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +89
   System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) +714
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +869
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
&lt;/pre&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;&lt;b&gt;&lt;font face="Verdana"&gt;Version Information:&lt;/font&gt;&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 &lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2802127.aspx</link><pubDate>Thu, 11 Dec 2008 18:00:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2802127</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2802127.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2802127</wfw:commentRss><description>&lt;p&gt;Hi Yitzhak,&lt;/p&gt;
&lt;p&gt;Could you &lt;a class="" href="http://blogs.msdn.com/davidebb/archive/2008/05/25/dynamic-data-ajax-and-javascript-errors.aspx"&gt;set EnablePartialRendering to false&lt;/a&gt; in the master page?&amp;nbsp; You should then get the full stack of where the null ref exception is happening, which should help us find the right next step.&lt;/p&gt;
&lt;p&gt;thanks,&lt;br /&gt;David&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2801875.aspx</link><pubDate>Thu, 11 Dec 2008 16:30:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2801875</guid><dc:creator>Yitzhak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2801875.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2801875</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Hi David,&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;I followed your instructions and so far it didn’t work.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Here are my steps:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph" style="MARGIN:0in 0in 10pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;font face="Calibri" size="3"&gt;1.&lt;/font&gt;&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;I created MyDynamicValidator.cs file and placed it in the App_Code folder.&lt;br /&gt;The file contains your code verbatim from your post above.&lt;/font&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;using&lt;/span&gt; System;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Linq;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.Web.DynamicData;
&lt;span class="kwd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;

&lt;span class="kwd"&gt;public class&lt;/span&gt; MyDynamicValidator : DynamicValidator
{
    &lt;span class="kwd"&gt;protected override void&lt;/span&gt; ValidateException(Exception exception)
    {
        &lt;span class="cmt"&gt;// If it&amp;#39;s not already an exception that DynamicValidator looks at&lt;/span&gt;
        &lt;span class="kwd"&gt;if&lt;/span&gt; (!(exception &lt;span class="kwd"&gt;is&lt;/span&gt; IDynamicValidatorException) &amp;amp;&amp;amp; !(exception &lt;span class="kwd"&gt;is&lt;/span&gt; ValidationException))
        {
            &lt;span class="cmt"&gt;// Find the most inner exception&lt;/span&gt;
            &lt;span class="kwd"&gt;while&lt;/span&gt; (exception.InnerException != &lt;span class="kwd"&gt;null&lt;/span&gt;)
            {
                exception = exception.InnerException;
            }

            &lt;span class="cmt"&gt;// Wrap it in a ValidationException so the base code doesn&amp;#39;t ignore it&lt;/span&gt;
            exception = &lt;span class="kwd"&gt;new&lt;/span&gt; ValidationException(&lt;span class="kwd"&gt;null&lt;/span&gt;, exception);
        }

        &lt;span class="kwd"&gt;base&lt;/span&gt;.ValidateException(exception);
    }
}
&lt;/pre&gt;&amp;nbsp; 
&lt;p class="MsoListParagraph" style="MARGIN:0in 0in 10pt 0.5in;TEXT-INDENT:-0.25in;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;"&gt;&lt;span style="mso-list:Ignore;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;2.&amp;nbsp; I modified the web.config file as shown below:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;pages&lt;/span&gt;&amp;gt;
   …
   &amp;lt;&lt;span class="tag"&gt;tagMapping&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="tag"&gt;clear&lt;/span&gt; /&amp;gt;
      &amp;lt;&lt;span class="tag"&gt;add&lt;/span&gt;&lt;span class="attr"&gt; tagType=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;System.Web.DynamicData.DynamicValidator&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; mappedTagType=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyDynamicValidator&amp;quot;&lt;/span&gt;/&amp;gt;
   &amp;lt;/&lt;span class="tag"&gt;tagMapping&lt;/span&gt;&amp;gt;
 &amp;lt;/&lt;span class="tag"&gt;pages&lt;/span&gt;&amp;gt;
&lt;/pre&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt; 
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;I placed a break point inside body of the &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;MyDynamicValidator &lt;/span&gt;&lt;font face="Calibri" size="3"&gt;class. The Dynamic Data application flow never came to the &lt;/font&gt;&lt;span style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;MyDynamicValidator &lt;/span&gt;&lt;font face="Calibri" size="3"&gt;class. &lt;br /&gt;It looks like that it was ignored. The Internet browser showed an error message in the message box:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Line: 4723&lt;br /&gt;&lt;/font&gt;&lt;font face="Calibri" size="3"&gt;Error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Is it possible that something else is missing? Please advise.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Regards,&lt;br /&gt;Yitzhak&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2799864.aspx</link><pubDate>Thu, 11 Dec 2008 01:02:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2799864</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2799864.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2799864</wfw:commentRss><description>&lt;p&gt;Here is a workaround which I think will work in the mean time.&amp;nbsp; First, define a control derived from DynamicValidator, and do something like this: &lt;/p&gt;
&lt;p&gt;&lt;span class="kwd"&gt;public class&lt;/span&gt; MyDynamicValidator : DynamicValidator {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;protected override void&lt;/span&gt; ValidateException(Exception exception) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmt"&gt;// If it&amp;#39;s not already an exception that DynamicValidator looks at&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;if&lt;/span&gt; (!(exception &lt;span class="kwd"&gt;is&lt;/span&gt; IDynamicValidatorException) &amp;amp;&amp;amp; !(exception &lt;span class="kwd"&gt;is&lt;/span&gt; ValidationException)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmt"&gt;// Find the most inner exception&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;while&lt;/span&gt; (exception.InnerException != &lt;span class="kwd"&gt;null&lt;/span&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exception = exception.InnerException;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="cmt"&gt;// Wrap it in a ValidationException so the base code doesn&amp;#39;t ignore it&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exception = &lt;span class="kwd"&gt;new&lt;/span&gt; ValidationException(&lt;span class="kwd"&gt;null&lt;/span&gt;, exception);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span class="kwd"&gt;base&lt;/span&gt;.ValidateException(exception);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Then make sure your control is used instead of DynamicValidator.&amp;nbsp; You can do this easily in web.config, as follows:&lt;/p&gt;&lt;pre class="coloredcode"&gt;    &amp;lt;&lt;span class="tag"&gt;pages&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="tag"&gt;tagMapping&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;add&lt;/span&gt;&lt;span class="attr"&gt; tagType=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;System.Web.DynamicData.DynamicValidator&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; mappedTagType=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyDynamicValidator&amp;quot;&lt;/span&gt;/&amp;gt;
      &amp;lt;/&lt;span class="tag"&gt;tagMapping&lt;/span&gt;&amp;gt;
    &amp;lt;/&lt;span class="tag"&gt;pages&lt;/span&gt;&amp;gt;
&lt;/pre&gt;
&lt;p&gt;In theory that should do the trick.&amp;nbsp; Let me know how that works for you.&lt;/p&gt;
&lt;p&gt;thanks,&lt;br /&gt;David&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2799131.aspx</link><pubDate>Wed, 10 Dec 2008 18:19:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2799131</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2799131.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2799131</wfw:commentRss><description>&lt;p&gt;Hi &lt;font face="Calibri" size="3"&gt;Yitzhak,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Calibri" size="3"&gt;Yes, you would get two calls to the DB. We discovered the problem is in the ADO Entity Framework - specifically that SaveChanges is not virtual. We&amp;#39;ve made a request to the EF team to fix the problem. We hope the problem will be fixed in the next release.&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2798413.aspx</link><pubDate>Wed, 10 Dec 2008 13:47:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2798413</guid><dc:creator>Yitzhak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2798413.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2798413</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Hi Rick,&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;It is an interesting idea to call stored procedures in the &lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;Onvalidate/OnSavingChanges event handlers. &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;But wouldn’t such scenario produce 2 calls to the database?&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;First, from the custom code &lt;/span&gt;in the &lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;Onvalidate/OnSavingChanges event handler and second, immediately after that by the native Dynamic Data application execution path.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;P.S. Did you have a chance to consult with the Dynamic Data development team on the subject?&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Regards,&lt;br /&gt;Yitzhak&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;&amp;nbsp;&lt;/font&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to display errors from stored procedures?</title><link>http://forums.asp.net/thread/2793815.aspx</link><pubDate>Mon, 08 Dec 2008 20:25:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2793815</guid><dc:creator>ricka6</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2793815.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2793815</wfw:commentRss><description>&lt;p&gt;Hi &lt;font face="Calibri" size="3"&gt;Yitzhak,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Calibri" size="3"&gt;I think you should be able to run your stored proc from Onvalidate/OnSavingChanges. Let me know if that works - in the mean time we&amp;#39;ll investigate.&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>