Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As an addition to the post of Atif Aziz, here the VB.NET version (InitializeElmah_VB9 for the .NET 2.0 version [without lamdda], InitializeElmah for VB.NET for .NET 4.0)</p> <pre class="lang-vb prettyprint-override"><code>Imports System.Web.SessionState Public Class Global_asax Inherits System.Web.HttpApplication Public Overrides Sub Init() MyBase.Init() InitializeElmah_VB9() 'InitializeElmah()' End Sub Public parent As Elmah.ServiceProviderQueryHandler = Nothing Sub InitializeElmah_VB9() ' TODO: Create Table + Functions ' parent = Elmah.ServiceCenter.Current Elmah.ServiceCenter.Current = AddressOf ElmahCallback End Sub Function ElmahCallback(objContext As Object) As System.IServiceProvider Dim container As New System.ComponentModel.Design.ServiceContainer(parent(objContext)) Dim connectionSettings As System.Configuration.ConnectionStringSettings = ConfigurationManager.ConnectionStrings("FOOBAR") Dim strConnectionString As String = connectionSettings.ConnectionString Dim x As New System.Data.SqlClient.SqlConnectionStringBuilder(strConnectionString) x.Password = CryptStrings.DeCrypt(x.Password) strConnectionString = x.ConnectionString Dim log As Elmah.SqlErrorLog = New Elmah.SqlErrorLog(strConnectionString) container.AddService(GetType(Elmah.ErrorLog), log) Return container End Function Sub InitializeElmah() ' TODO: Create Table + Functions ' Dim parent As Elmah.ServiceProviderQueryHandler = Elmah.ServiceCenter.Current Elmah.ServiceCenter.Current = Function(context) Dim container As New System.ComponentModel.Design.ServiceContainer(parent(context)) Dim connectionSettings As System.Configuration.ConnectionStringSettings = ConfigurationManager.ConnectionStrings("Foobar") Dim connectionString As String = connectionSettings.ConnectionString Dim x As New System.Data.SqlClient.SqlConnectionStringBuilder(connectionString) x.Password = CryptStrings.DeCrypt(x.Password) connectionString = x.ConnectionString Dim log As Elmah.SqlErrorLog = New Elmah.SqlErrorLog(connectionString) container.AddService(GetType(Elmah.ErrorLog), log) Return container End Function End Sub Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) ' Wird beim Starten der Anwendung ausgelöst End Sub Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) ' Wird beim Starten der Sitzung ausgelöst End Sub Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) ' Wird zu Beginn jeder Anforderung ausgelöst End Sub Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) ' Wird beim Versuch der Benutzerauthentifizierung ausgelöst End Sub Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) ' Wird bei einem Fehler ausgelöst End Sub Sub Session_End(ByVal sender As Object, ByVal e As EventArgs) ' Wird beim Beenden der Sitzung ausgelöst End Sub Sub Application_End(ByVal sender As Object, ByVal e As EventArgs) ' Wird beim Beenden der Anwendung ausgelöst End Sub End Class </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload