My code reads some entities (Clerk, in this case) from database, and the tries to delete one of them.
The code (as usual) is DataContext.Clerks.DeleteOnSubmit(this);
"This" is an instance read from the previous query.
When I execute DataContext.SubmitChanges() thru the following method (in a partial class file)
Code: Select all
public bool SendChanges( out string why)
{
bool result = true;
why = String.Empty;
try {
SubmitChanges();
}
catch (Exception e) {
why = e.Message;
if (e.InnerException != null)
why = String.Format("{0} - {1}", e.Message, e.InnerException.Message);
result = false;
}
return result;
}
Of course, I can insert and update without trouble.
What could be going?
TIA