Results 1 to 3 of 3

Thread: The type initializer give me an error

  1. #1
    Join Date
    Jan 2009
    Posts
    36

    The type initializer give me an error

    Hi,

    I am trying to open an OleDb connection for access it gives me the following error.

    The type initializer for
    'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception.

    Code:
    Private Sub OpenConnection()
    If _connection Is Nothing Then
    _connection = New OleDb.OleDbConnection(_connStr)
    _connection.Open()
    Else
    If _connection.State = ConnectionState.Open Then
    Else
    _connection.Open()<------- ERRROR HERE
    End If
    End If
    End Sub

  2. #2
    Join Date
    Jan 2009
    Posts
    44

    Re: The type initializer give me an error

    Well i think you are getting confused with the concept of ADO.NET
    Since you are opening the connection but not closing it.
    You are trying to open the connection which is already open.
    Try
    Connection.Closed()

    I think this is your problem.

  3. #3
    Join Date
    Jan 2009
    Posts
    36

    Re: The type initializer give me an error

    Thanks for the help I think my code is wrong!
    I need to do this other way!

Similar Threads

  1. HTC Sense give 404 error in HTC Sensation XL
    By Bishwajeet in forum Portable Devices
    Replies: 4
    Last Post: 29-11-2011, 01:44 AM
  2. Replies: 4
    Last Post: 20-03-2011, 03:25 AM
  3. Call of Duty: Black ops 3D Vision give error
    By Raveroy in forum Video Games
    Replies: 4
    Last Post: 08-12-2010, 10:40 AM
  4. Certain Websites give error in Mozilla firefox
    By Adikavi in forum Technology & Internet
    Replies: 4
    Last Post: 02-03-2010, 08:13 AM
  5. Windows Update Website Give Error message
    By ABBOTT in forum Technology & Internet
    Replies: 3
    Last Post: 03-03-2009, 07:19 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,392,883.63907 seconds with 16 queries