473,387 Members | 3,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

'late binding' to load an ADO driver

Hi All,
this is a bit tricky: i am writing an application that uses ADO.NET.
the trick is: i dont know in advance what driver it would be. i want
to let user point to a DLL (which has to be an ADO.NET driver) and in
'late binding' (to use activeX terms... yes i am that old) load it and
then use objects it exposes (connection, DataAdapter, etc...)

can this be done? anybody know of any code snippet that could get me
started?

thanks!
Jul 25 '08 #1
1 1142
1. Can this be solved by the connection string or do you hve to alter the
SQL? If you are using OLEDB, you should be able to just alter the connection
string. If you are trying to optimize, examine question 2.

2. Is this truly random, or are you working from a known set of drivers?
This will determine whether or not you can use a factory pattern over
multiple drivers.

With #1, you might just have the configuration file feed the proper
connection string, which can include a provider type. If you want a bit more
efficiency, add a factory method (#2) and optimize the transport (SqlClient
for SQL Server, etc.). ALl of this can be accomplished with the enterprise
library (download from MS downloads) rather easily, as the factory is
already in place. Just a few config changes and a bit of a learning curve.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************
"Jonathan Sion" <yo**@nobhillsoft.comwrote in message
news:83**********************************@s50g2000 hsb.googlegroups.com...
Hi All,
this is a bit tricky: i am writing an application that uses ADO.NET.
the trick is: i dont know in advance what driver it would be. i want
to let user point to a DLL (which has to be an ADO.NET driver) and in
'late binding' (to use activeX terms... yes i am that old) load it and
then use objects it exposes (connection, DataAdapter, etc...)

can this be done? anybody know of any code snippet that could get me
started?

thanks!
Jul 26 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: ThunderMusic | last post by:
Hi, I have some code to load some plug-ins, but the code requires me to know the name of the class to load (here: SamplePlugin, derived from IPlugin) : (Here is some C# code, but I use VB.Net to...
9
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
5
by: Daniel Bass | last post by:
..Net is great for modulerising libraries, so that all you need do to access a DLL, is simply call Add Reference and wallah, it's as though the library were written in your project. But what...
1
by: Jim | last post by:
Hey all I'm trying to late bind a VB6 object in Component Services using c#. I've been able to do tons of late binding, but now that I have a com+ object that doesn't have a method exposed...
5
by: Pete | last post by:
Hi, I want to essentially perform late binding in c#. The rough equivalent in VB (6) would be: dim x as ifcMyInterface dim SensibleClassName as string SensibleClassName = .... 'something...
1
by: tlwright1414 | last post by:
I have Assembly A which late binds Assembly B using the following code... Assembly b = Assembly.LoadFile(@"C:\dev\B.dll"); object o = b.CreateInstance( "NameSpaceB.ClassB" ); object oEmitObj =...
0
by: ThunderMusic | last post by:
Hi, I have some code to load some plug-ins, but the code requires me to know the name of the class to load (here: SamplePlugin, derived from IPlugin) : using System; using System.Reflection; ...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
7
by: Entwickler | last post by:
hello, i have the following problem. i want to write a code that enables the user to call functions from a unmanaged code .dll at running time . so i have to use the late binding . i tried the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.