B
Bjorn Abelli
...
I see. Why not just put the connection info for each database
into a DLL and load it dynamically? You are already have to
specify the specific assembly in the Assembly.Load() part.
So the INI doesn't seem to help here.
I think you confuse the two concepts with each other...
My application will read from the configuration file (plain text, e.g. an
ini-file), to get the information needed to do the reflection (loading the
right assembly).
That way, I will not need to create a new dll each time I want to configure
for a new DB-connection. I just add some lines in the ini-file, e.g.:
----------------
[Test]
provider = "System.Data, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
cclass = "System.Data.OleDb.OleDbConnection"
aclass = "System.Data.OleDb.OleDbDataAdapter"
cstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=test.mdb"
[MySQL]
provider = "MySql.Data"
cclass = "MySql.Data.MySqlClient.MySqlConnection"
aclass = "MySql.Data.MySqlClient.MySqlDataAdapter"
cstring = "Database=Test;Data Source=localhost;User
Id=username;Password=password"
----------------
(The lines above will probably wrap in the post, but nevermind...)
So why would I make myself the trouble of compiling a dll, when all I need
is to add a few plain text lines?
Is it possible I could see a simple working copy once
you have it available?
Sure, when it's available... ;-)
// Bjorn A