﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><pubDate>Tue, 28 Sep 2010 18:50:53 GMT</pubDate><dc:creator>karlp@agrecon.com</dc:creator><description>&lt;p&gt;Thanks Handy,&lt;/p&gt;
&lt;p&gt; Though I may have muddied the waters by mentioning identity.  The problem is not with identity insert but rather with vioalting a unique or primary key constraint, for example if you have a unique constraint on some kind of name column and a user tried to insert a duplicate. This will cause the db constraint violation exception to flow to the user, the only way of stopping it is to wright your own Insert method and explicity catch the exception and throw your own message instead. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Karl&lt;/p&gt;</description></item><item><title>Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><pubDate>Tue, 28 Sep 2010 10:09:06 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;When you handle identity incorrectly, it will return error exception. Please try to handle your select identity correctly.&lt;br /&gt;&lt;br /&gt;e.g &lt;a href="http://msdn.microsoft.com/en-us/library/aa933208(v=sql.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa933208(v=sql.80).aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><pubDate>Mon, 27 Sep 2010 23:59:31 GMT</pubDate><dc:creator>karlp@agrecon.com</dc:creator><description>&lt;p&gt;I had auto Incrementing ID fields so I had to write custom insert methods anyway that retreive the Identity values.  I simply caught the  sql exception  there  and checked if it was a unique key constraint violation and if it was i threw a new exception with a more generic and user firendly message.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><pubDate>Fri, 24 Sep 2010 03:33:01 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello Karl,&lt;/p&gt;&lt;p&gt;The messaging display is coming from server/database as default. You could not change it. &lt;br /&gt;FYI, you only can change the error message if there are an unusual error that came because of server response failure. For this error, you can change the text in UnhandledError clientside events.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Catch WebGrid Key Constraint violation</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Catch-WebGrid-Key-Constraint-violation/</link><pubDate>Wed, 22 Sep 2010 22:29:18 GMT</pubDate><dc:creator>karlp@agrecon.com</dc:creator><description>&lt;p&gt;IS there any way to catch A unique or primary key constraint violation when adding rows .&lt;/p&gt;
&lt;p&gt;I'm using ISDatasource binding and cant seem to work out how to catch the error and display a more user firendly message when someone tries to add a duplicate record.&lt;/p&gt;
&lt;p&gt;the client side OnAfterResponseProcess  does not fire&lt;/p&gt;
&lt;p&gt;OnResponse does fire but simply has status="Error"  how can i inspet the error response and prevent the contraint violation message displaying.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Karl&lt;/p&gt;</description></item></channel></rss>