Click here to Skip to main content
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 23:57pm
DGKumar759
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 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2014
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