Loading Assemblies, when the interface is not defined by your application

T

Timothy

Hi,

As an addition to my previous question

The following code is not allowed because the IDbConnection interface is
not defined by my application (right ?)

So how can I make this work ?

ObjectHandle hNdl =
Activator.CreateInstanceFrom(@"data\MyData.Data.dll","MyData.Data.MyDataClient.MyDataConnection");
IDbConnection dbConnection = (IDbConnection)hNdl.Unwrap();

Thnx.

TP
 
G

Gaurav Khanna [C# MVP]

Hi!

Put a reference to System.Data.dll assembly and use the System.Data
namespace. That should do the trick.

--
Regards,
Kumar Gaurav Khanna
-----------------------------------------------------------------
Microsoft MVP - C#/.NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
http://www.wintoolzone.com/
OpSupport - Spelunking Rotor
http://opsupport.sscli.net/
Bangalore .NET Users' Group
http://groups.msn.com/bdotnet/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top