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