Results 1 to 3 of 3

Thread: [2005] The type initializer '...' threw an exception

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    2

    [2005] The type initializer '...' threw an exception

    Hi everybody
    I have a problem, which is:

    My Project used to work fine until I have taken the latest version from the sourcesafe.
    It gave me some errors first, but I have fixed them .. Building successfully. However, when executing, this error message pops-up to me

    The type initializer 'Common.DataAccessLayer.SQLWrapper' threw an exception

    This exception happens when I call function A let's say, from a (2nd project) & A calls function B let's say, from a 3rd Project
    When A calls B --> Exception is triggered

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    2

    Re: [2005] The type initializer '...' threw an exception

    Hi RhinoBull
    It's like this: (Projects am using with thier hierarchy order)
    • Data Access Application Block 2006 (Microsoft.Practices.EnterpriseLibrary)
      1. ObjectBuilder
      2. Common
      3. Data
    • Common
    • Chart
    • ReferencesUI


    In the ReferencesUI..Most of the WebForms uses this kind of code:
    Code:
            Private Sub Refresh()
                Try
                ...
                    Dim objFiscalYear As New FiscalYear
                    drpFiscalYear.DataSource = objFiscalYear.GetAllFiscalYear
                ...
                Catch ex As Exception
                ...
                End Try
            End Sub
    The Order of the Projects Execution is like this:
    ReferencesUI --> Chart --> Common

    In details, It's executed like this:

    From ReferencesUI:
    Inside Account.aspx.vb:
    it executes this:
    objFiscalYear.GetAllFiscalYear

    & then It goes to Chart:
    Inside FiscalYear.vb:
    it executes this:
    Code:
            Public Function GetAllFiscalYear() As FiscalYearCollection
                Dim ConString As String
                Dim FiscalYears As New FiscalYearCollection
                Dim ConSettings As New Settings
                ConString = ConSettings.ConnectionString
    
                Dim FiscalYearDr As SqlDataReader = SQLWrapper.ExecuteReader(ConString, "FiscalYear_SelectAll")
                ...
                End Function
    Then a window is poped:
    The type initializer 'Common.DataAccessLayer.SQLWrapper' threw an exception
    Wanna Learn More Programming Languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width