KMC
KMC

Reputation: 20046

Create ADO.NET adaptor for SQLite

How to create a ADO.NET adaptor for SQLite (i.e. generate my own DLLs from SQLite C source code, instead of using other existing DLLs or NuGet to install SQLite.) I want to do it as a learning experience but find no instruction on google.

I will use C#.NET in WPF VS2015 on x64. Do I compile the source in VC++ as a DLL and then reference to it in a new solution ? Will the DLL be x86 and x64 compatible or do I generate two separate DLLs?

Upvotes: 0

Views: 210

Answers (1)

jleach
jleach

Reputation: 7792

That's a big undertaking for a learning project, but ok. Curious though, why VC++? You can create a C# class library and access the sqlite dll via PInvoke, then create your public interface around those. This will also make it easier to derive from the base ADO.NET classes that will make it suitable as an actual ADO provider library.

For x86 vs x64, it depends. You can use all x86 calls to sqlite regardless of the target architecture, or you can split them into separate architectures if you wish to use the x64 specifics for 64bit releases. Personally, I wouldn't worry about this aspect too much until I had a good handle on the fundamentals of creating the actual wrapper/library/provider.

Upvotes: 1

Related Questions