Error Loging in ASPNET
| Published on 2/22/2005 by Site Editor More articles in ASP.NET
|
You may manage error handling configuring Web.Config file. In this code we will try to log this error page in to an SQL Server. This script will be helpful to webmaster to get a control over web pages.
Run this code to create table :
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[errorLog]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
CREATE TABLE [dbo].[errorLog] (
Now we will create our stored procedure :
CREATE PROCEDURE dbo.insertLog
Now if doed not exist web.config file create one or modify it with those codes :
Ok. Our hard work finished after modifying our database connection. Double check that you have run sql scripts correctly without any error. You may use SQL Query Analyzer. Do not miss to check SQL connection. After editing and upload this script to your site.
<%@ Page Language="VB" Debug="true" %>
 Dim objCon As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("strCon"))
You may check error table to find error pages. Automatically script inserts errors and gives you to repair errors.
|
no comments submitted
Latest Posts
- Autocomplete Filter from the Old Futures Project Working in Dynamic Data 4
- Developing a Facebook Connect Application Using ASP.NET
- Conditional Row Highlighting in Dynamic Data
- UserControl as a DLL Made Easy
- Using GroupTemplate in ASP.NET ListView Control (Tiled Display)
- Creating Master-Detail GridView Using jQuery
- ASP.NET MVC 2.0 and AJAX Part 1
- Sorting Tabular Data in ASP.NET MVC
- Asynchronous Form in ASP.NET MVC 2
- Populating ASP.NET TreeView Control Recursively
- Understanding ClientIDMode Mode Feature in ASP.NET 4
- ASP.NET Application and Page Life Cycle
- ASP.NET MVC and File Uploads
- Google Map 3 with Multiple locations using Asp.Net C#
- Ajax, Asp.net Ajax, jQuery � Misconceptions and Facts
- ASP.NET MVC 2.0 Areas
- Latitude and Longitude Lookup with jQuery, C#, ASP.NET MVC
- WebMatrix - A First Application
- ViewStateMode in ASP.Net 4.0
- Securing Dynamic Data 4 (Replay)



