I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have just discovered a duplicate key error when attempting a database insert. However, I had to use SQL Profiler to find the error. The insert template page just silently did nothing.
How can I trap errors like this and log them and maybe display a message?