Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New exception?
Message
De
03/10/2012 14:54:35
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01554234
Message ID:
01554237
Vues:
52
Let's backup a bit.

Is this a web app or desktop? Where is the context defined?

>Hi everybody,
>
>I am writing a method to delete a cient in my Repository class. Here is what I've started from:
>
>
>public void DeleteClient(int clientId, bool autoCommit = true)
>        {
>            var ReordersQuery = from reord in this.Reorders
>                                where reord.ClientId == clientId
>                                select reord;
>
>            if (ReordersQuery.Any())
>                //throw "Client " + clientId.ToString() + " can not be deleted because it has related rows in the ReOrders table!";
>
>        }
>
>I read help on throw as I need to throw a new exception. My question is - what kind of exception it should be?
>
>Thanks in advance.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform