Library code snippets
Health Monitoring in ASP.NET 2
- Installing & Configuring
- WebEvents Class
- Event Class
WebEvents Class
Imports DeveloperMeeting
Imports DeveloperMeeting.DataProvider
Namespace EventLog
Public NotInheritable Class WebEvents
#Region " Constructor "
Public Sub New(ByVal ConnectionString As String)
_ConnectionString = ConnectionString
DSEventLog = SqlDataProvider.FillDataSet(ConnectionString, _
"DM_WebEvent_GetLogEvent", _
CommandType.StoredProcedure, Nothing)
End Sub
#End Region
#Region " Declarations "
Dim DSEventLog As New DataSet
Dim _ConnectionString As String
#End Region
#Region " Propreties "
Public ReadOnly Property Count() As Integer
Get
Return DSEventLog.Tables(0).Rows.Count
End Get
End Property
#End Region
#Region " GetEventLog Method "
Public Function GetEventLog(ByVal Index As Integer) As [Event]
Dim Return_Value As New [Event]
With Return_Value
.EventID = DSEventLog.Tables(0).Rows(Index)("EventId")
.EventTimeUtc = DSEventLog.Tables(0).Rows(Index)("EventTimeUtc")
.EventTime = DSEventLog.Tables(0).Rows(Index)("EventTime")
.EventType = DSEventLog.Tables(0).Rows(Index)("EventType")
.EventSequence = DSEventLog.Tables(0).Rows(Index)("EventSequence")
.EventOccurrence = DSEventLog.Tables(0).Rows(Index)("EventOccurrence")
.EventCode = DSEventLog.Tables(0).Rows(Index)("EventCode")
.EventDetailCode = DSEventLog.Tables(0).Rows(Index)("EventDetailCode")
.Message = IIf(DSEventLog.Tables(0).Rows(Index)("Message") Is DBNull.Value, _
vbNullString, DSEventLog.Tables(0).Rows(Index)("Message"))
.ApplicationPath = IIf(DSEventLog.Tables(0).Rows(Index)("ApplicationPath") _
Is DBNull.Value, vbNullString, DSEventLog.Tables(0).Rows(Index)
("ApplicationPath"))
.ApplicationVirtualPath = IIf(DSEventLog.Tables(0).Rows(Index) _
("ApplicationVirtualPath") Is DBNull.Value, vbNullString, _
DSEventLog.Tables(0).Rows(Index)("ApplicationVirtualPath"))
.MachineName = DSEventLog.Tables(0).Rows(Index)("MachineName")
.RequestUrl = IIf(DSEventLog.Tables(0).Rows(Index)("RequestUrl") _
Is DBNull.Value, vbNullString, DSEventLog.Tables(0).Rows(Index)("RequestUrl"))
.ExceptionType = IIf(DSEventLog.Tables(0).Rows(Index)("ExceptionType") _
Is DBNull.Value, vbNullString, DSEventLog.Tables(0).Rows(Index) _
("ExceptionType"))
.Details = IIf(DSEventLog.Tables(0).Rows(Index)("Details") Is DBNull.Value, _
vbNullString, DSEventLog.Tables(0).Rows(Index)("Details"))
End With
Return Return_Value
End Function
Public Function GetEventLog() As DataSet
Return DSEventLog
End Function
#End Region
#Region " ClearAllEvent Method "
Public Sub ClearAllEvent()
SqlDataProvider.ExecuteQuery(_ConnectionString, "DM_WebEvent_ClearAllEvent", _
CommandType.StoredProcedure, Nothing)
End Sub
#End Region
End Class
End Namespace
Related articles
Related discussion
-
Gizmox Announces release of Visual WebGui SDK version 6.2.2
by Visual WebGui (0 replies)
-
Error 4 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).
by lbargers (3 replies)
-
How to receive data in web server sending from GPRS modem
by AshokSingh (1 replies)
-
Working with frames in c# .net
by pulak2008 (0 replies)
-
Time Out Problem
by lorrainepetty (1 replies)
Related podcasts
-
CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly Media
CodeCast Episode 4: State of .NET, IE8, ASP.NET MVC, and O'Reilly MediaHosts Ken Levy and Markus Egger discuss the new State of .NET events, IE8, ASP.NET MVC, followed by an interview from PDC with two editors from O'Reilly Media. More on ASP.NET MVC can be found at http://asp.net/mvc. Interview...
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum) -
Microsoft Dynamics CRM Technical Consultant
in Netherlands (€50K-€90K per annum) -
.net developer
in Rijswijk (€2K-€4K per annum)
Events coming up
-
Dec
9
Internet Information Services 7.0 for ASP.Net Developers
Glasgow, United Kingdom
One of the biggest and best new features of Windows Server 2008 and Windows Vista is Internet Information Server 7.0. IIS 7.0 is the latest and most significant release of Microsoft's Web Server. With this release comes a new extensibility model which gives developers more options than ever before, more diagnostic tools with which developers can debug and locate issues. During the session Andrew will investigate the new architecture, look at extending, configuring and developing for IIS7, ta...
Hi Mehdi Golchin,
Thanks for you guide. I have successed to configure the aspnet_regsql.
regard,
Jason
Hi Jason,
Health monitoring uses SQL Server for storing web events. so you must add health monitoring's tables and stored procedures. for that you have tow solutions. you can use aspnet_regsql command in visual studio command prompt or if you like to create a installation page for your project you can use
that code which generates health monitoring's tables and stored procedures as run-time.
Dear Mehdi Golchin,
With regard to your Step 1, can you please explain more in details "run-time mode". As i do not know where to install it Many thanks...
Step 1 : Installing Web Event
You can do this easily in run-time mode with this code below:
This thread is for discussions of Health Monitoring in ASP.NET 2.