Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managed OleDB provider written in C#

Tags:

c#

com

oledb

An OleDB provider is a binary implementing COM interfaces provided by Microsoft. From that it seems to be possible to create a provider using C#. Is that correct? Is there a sample demonstrating that? If not, would you discourage me from doing that? I see that there are multiple unmanaged samples but I can't find any managed.

like image 561
David Pokluda Avatar asked Nov 26 '22 17:11

David Pokluda


1 Answers

The article is good, but doesn't actually answer the question. OLEDB is a set of COM interfaces that could in fact be implemented in .Net via COM Interop though I've never heard of such an implementation and probably isn't advisable.

The set of OLEDB interfaces are documented by Microsoft here. OLEDB is a complicated topic and not all interfaces are required to implement a functional provider. To make things worse, different OLEDB clients have the set of interfaces they require to be able to use the provider. For example, here is a list of require interfaces that must be implemented to use a provider from the .Net OLEDB client (System.Data.OleDb.*). Note: I didn't find such a link for the 2.0 Framework or later. Finally it's worth noting that it was so difficult to implement providers Microsoft later provided a set of ATL templates (C++) to help implementers do it correctly.

To learn more about OLEDB I'd definitely recommend looking at the Windows Data Access SDK on MSDN.

like image 61
Peter Oehlert Avatar answered Dec 18 '22 10:12

Peter Oehlert