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. Advertisements

  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. Advertisements

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. Timothy
    Replies:
    1
    Views:
    612
    Gaurav Khanna [C# MVP]
    Jan 27, 2004
  2. Danish Ahmed

    Dynamically Loading Assemblies in ASP.NET

    Danish Ahmed, Apr 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,040
    Lionel LASKE
    Apr 17, 2005
  3. =?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:
    458
    =?Utf-8?B?UmFuYQ==?=
    Jun 10, 2005
  4. WT
    Replies:
    5
    Views:
    6,377
    gerardopg
    Jun 5, 2010
  5. Oodini
    Replies:
    1
    Views:
    2,037
    Keith Thompson
    Sep 27, 2005
  6. Tor Bådshaug
    Replies:
    1
    Views:
    2,285
    bruce barker
    May 22, 2008
  7. Replies:
    1
    Views:
    671
    Sion Arrowsmith
    Jul 10, 2008
  8. Garry

    Composite Assemblies Not Loading

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