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

Discussion in 'ASP .Net' started by Timothy, Jan 24, 2004.

  1. Timothy

    Timothy Guest

    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
    Timothy, Jan 24, 2004
    #1
    1. Advertising

  2. 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/
    "Timothy" <> wrote in message
    news:40123e6b$0$324$...
    > 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.MyDataClie
    nt.MyDataConnection");
    > IDbConnection dbConnection = (IDbConnection)hNdl.Unwrap();
    >
    > Thnx.
    >
    > TP
    Gaurav Khanna [C# MVP], Jan 27, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UmFuYQ==?=

    Loading Assemblies from a Newtwork PC - Web Application

    =?Utf-8?B?UmFuYQ==?=, Jun 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    361
    =?Utf-8?B?UmFuYQ==?=
    Jun 10, 2005
  2. WT
    Replies:
    5
    Views:
    6,178
    gerardopg
    Jun 5, 2010
  3. Oodini
    Replies:
    1
    Views:
    1,766
    Keith Thompson
    Sep 27, 2005
  4. Tor Bådshaug
    Replies:
    1
    Views:
    1,982
    bruce barker
    May 22, 2008
  5. Garry

    Composite Assemblies Not Loading

    Garry, Jul 14, 2003, in forum: ASP .Net Building Controls
    Replies:
    5
    Views:
    153
    Yan-Hong Huang[MSFT]
    Jul 18, 2003
Loading...

Share This Page