Almost the title of a great movie, huh?
In a previous incarnation of my database I had a SQL Server function POUserID() and the default for a field was set to this function.
CreatedBy int NOT NULL DEFAULT dbo.POUserID()
Now for the web version of my application I have done away with this. I have recreated the database, and the there is NO reference to this function, I have triple-verified this.
This code
public void SavePO(POEntity po)
{
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.SaveEntity(po, po.IsNew);
}
throws this exception
An exception was caught during the execution of an action query: Invalid object name 'dbo.POUserID'.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
The obvious thing is somehow I've missed something and this function is still lurking. But it ain't.