M
Mr. X.
Hello.
How can I use dll dynamically in my code?
Thanks
How can I use dll dynamically in my code?
Thanks


That's a pretty broad question. Depending upon what is needed, theHello.
How can I use dll dynamically in my code?
How can I use dll dynamically in my code?
Assuming that by "dynamically" you mean that you don't want to link your
own assembly to the DLL assembly you want to use (i.e. use a DLL not
known at compile time), then the basic approach involves reflection.
There is a new plug-in framework with .NET 4.0 that is supposed to make
this easier. If you can restrict your goal to something where that is
usable, then that would probably be a better approach.
Otherwise, you're
going to have to load the assembly explicitly, inspect it for relevant
types, and execute the code within all via reflection.

I meant :
I.e I want to load "System.Data.SqlClient dll" on runtime, and use some
of it's classes (such as SqlConnectionStringBuilder)
What I did for the sample you gave,
for MySql, I got the message :
=========================
Could not load file or assembly 'MySql.Data.MySqlClient' or one of its
dependencies. The system cannot find the file specified.
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.