Click here to Skip to main content
11,716,938 members (83,496 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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
DGKumar811
Comments
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
good
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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 659
1 F-ES Sitecore 260
2 Maciej Los 185
3 OriginalGriff 175
4 Richard MacCutchan 140
0 Sergey Alexandrovich Kryukov 1,029
1 Maciej Los 464
2 Richard MacCutchan 430
3 CHill60 415
4 OriginalGriff 415


Advertise | Privacy | Mobile
Web03 | 2.8.150901.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