Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C#"The type initializer for '<Module>' threw an exception." unter Windows XP embedded

Empfohlene Antworten

Veröffentlicht

Hallo,

Ich habe ein Programm in c# geschrieben welches eine ODBCConnection benutzt (Connectionstring: "Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\MyDB.mdb;") um sich auf eine Access 2000 Datenbank (unter Access 2007 erstellt) aufzusetzen. Auf meinem Laptop (Windows XP Pro SP3 deutsch) selber funktioniert es, aber auf dem Panel (Windows XP Enbedded SP2 multilanguage) kommt beim Verbinden mit der Datenbank immer folgender Fehler "The type initializer for '<Module>' threw an exception.". Bis Jetzt habe ich leider keine Lösung gefunden und wäre sehr dankbar für eine schnelle Hilfe.

Gruß Tassadar

Hier der Code


public void DB_ConnectToLanguageDB()

        {

            string connString;

            // Yves DB übergehen  30.09.2008

            if (!DesignTime)

            {

                connString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=" + System.Windows.Forms.Application.StartupPath + "\\Config\\Messages.mdb;";//Uid=Admin;Pwd=;

                //connString = @"Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\_BDT\MPS\Config\Messages.mdb";

                conn = new OdbcConnection(connString);


                DB_Connect();       

            }

            else

                DB_Connected = false;

        }


        public void DB_Connect()

        {

            if (conn != null)

            {

                try

                {

                    conn.Close();

                    conn.Open();

                    DB_Connected = true;

                    LogMessages("DB_Connect", DB_Connected.ToString());

                }

                catch (Exception ex)

                {

                    MessageBox.Show("Error in FrmMain.FrmMain(): Cannot connect Message DB\n\nConnectionstring: " + conn.ConnectionString + "\nException: " + ex.Message, "Exception");

                    DB_Connected = false;

                    LogMessages("DB_Connect", conn.ConnectionString);

                    LogMessages("DB_Connect", ex.Message);

                    LogMessages("DB_Connect", DB_Connected.ToString());

                }          

            }

            else

            {

                DB_Connected = false;

                LogMessages("DB_Connect", "Connection = null");

                LogMessages("DB_Connect", DB_Connected.ToString());

            }

        }

Ich habe jetzt eine rekursive Funktion geschrieben um die Fehlermeldung der untersten Ebene zu erhalten. Dabei ist folgendes herausgekommen:

Exception: The type initializer for '<Module>' threw an exception.

Exception: The C++ module failed to load.

Exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.