You can handle errors thrown by the SqlDataSource control by handling any or all of
the following four events: Deleted, Inserted, Selected, Updated
Each of these events is passed an EventArgs parameter that includes any exceptions raised
when the command was executed.
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
File: Web.config
connectionString="Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />