Groups | Blog | Home
all groups > dotnet faqs > january 2004 >

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



Timothy
1/24/2004 10:44:19 AM
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.

Gaurav Khanna [C# MVP]
1/27/2004 12:16:58 PM
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/
[quoted text, click to view]
Activator.CreateInstanceFrom(@"data\MyData.Data.dll","MyData.Data.MyDataClie
nt.MyDataConnection");
[quoted text, click to view]

AddThis Social Bookmark Button