Re: 'System.TypeLoadException' occured when calling Database access from a DLL that is referenced from PPC
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 05/19/04
- Next message: Chris Tacke, eMVP: "Re: cabwiz - number of files limitation"
- Previous message: Michael J. Salamone [eMVP]: "Re: How to determine whether your PPC app is running in emulation or on physical device"
- In reply to: Callon Campbell: "'System.TypeLoadException' occured when calling Database access from a DLL that is referenced from PPC"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 19 May 2004 18:46:09 +0100
Callon Campbell <campbelc@norbord.com> wrote:
> What I'm doing is this. I have a PPC app in C# (VS.NET 2003) that
> communicates to a SQL Server 2000 database server. I'm using direct
> connection via the System.Data.SqlClient namespace. So I created a
> Connection and Data class which connects to the DB and performs a
> vary of SQL calls, mostly calling stored procs.
>
> At first these two classes where part of my PPC app (exe) and worked
> just great. I then needed to move these two classes out into their
> own assembly, with a diff namespace so that two distinct PPC and CE
> apps could leverage them.
>
> When I did this, I got an error message when calling ANY function
> from these classes that talks to the database. The error Message was:
>
> "An unhandled exception of type 'System.TypeLoadException' occured in
> System.Windows.Forms.Dll
>
> Additional information: Could not load type
> System.Data.SqlClient.SqlConnection from assembly System.Data,
> Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=B77A5C561934E089"
>
> Any help would be greatly appreciated. Can I not put my common
> dataaccess routines in their own assembly and have other EXE or DLL's
> reference them? If so what am I missing. If not then please let me
> know.
Yes you can. However, you need to make sure that your library assembly
is copied to the appropriate place (usually the same directory as the
executable). Have you checked on the device (or emulator) to make sure
that the executable and the library are in the same place?
-- Jon Skeet - <skeet@pobox.com> http://www.pobox.com/~skeet If replying to the group, please do not mail me too
- Next message: Chris Tacke, eMVP: "Re: cabwiz - number of files limitation"
- Previous message: Michael J. Salamone [eMVP]: "Re: How to determine whether your PPC app is running in emulation or on physical device"
- In reply to: Callon Campbell: "'System.TypeLoadException' occured when calling Database access from a DLL that is referenced from PPC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|