Click here to Skip to main content
11,802,389 members (29,891 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL-server-2005 C# SQL-Server , +
If i want to delete relation oriented records in webgrid in MVC 3 it should display foreign key relation maintained exception
so i would like to Display that massage in Alert box to User with out sql exception
how it is possible please send the Answer.
Posted 25-Mar-13 22:57pm
aspnet_regiis -i at 26-Mar-13 5:03am
How are you checking that the -"record is relation oriented"? Can you show your code?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you have maintain relationships in database level then database engine will not allow to delete
such records. you only have to capture such errors when deleting such records.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 475
1 KrunalRohit 366
2 F-ES Sitecore 295
3 Afzaal Ahmad Zeeshan 230
4 CHill60 220
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,645
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100