iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
IS there any way to catch A unique or primary key constraint violation when adding rows .
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.
the client side OnAfterResponseProcess does not fire
OnResponse does fire but simply has status="Error" how can i inspet the error response and prevent the contraint violation message displaying.
Karl
Thanks Handy,
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.
thanks,
Hello Karl,
The messaging display is coming from server/database as default. You could not change it. 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.
Regards,Handy
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.
When you handle identity incorrectly, it will return error exception. Please try to handle your select identity correctly.e.g http://msdn.microsoft.com/en-us/library/aa933208(v=sql.80).aspx
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname