Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
New exception?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
New exception?
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01554234
Message ID:
01554234
Views:
92
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.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform