Handling SQL Command Execution Errors
Whenever you build a software application, you need to plan for failure. Databases go down, users enter unexpected values in form fields, and networks get clogged. It is miraculous that the Internet works at all.
You can handle errors thrown by the SqlDataSource
control by handling any or all of the following four events:
• Deleted
—
Happens immediately after the SqlDataSource
executes its delete
command.
• Inserted
—
Happens immediately after the SqlDataSource
executes its insert
command.
• Selected
—
Happens immediately after the SqlDataSource
executes its select
command.
• Updated
—
Happens immediately after the SqlDataSource
executes its delete
command.
Each of these events is passed an EventArgs parameter ...
Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.