The solution that I had found was to implement my own .NET Data Provider. I used as basis an example posted on msdn: Implementing a .NET Framework Data Provider.
The article provides a template implementation of a "Fake/Sample" data provider for an in-memory database "Fake/Sample". If you are investigating in this direction then following the above link will be very helpful.
For your convenience I have created a sample wpf app using this code. The code is an identical copy of the original; I have only made some improvements to make it up-to-date with .NET 4.0 since the initial article was written for .NET 1.0
You can checkout the sources using tortoise: http://bakopanos.googlecode.com/svn/trunk/blog/DotNetDataProviderTemplate/
I used Visual Studio 2010 for this :-)
An overview of the code
The "fake/sample" database in the sample mimics a real world database that returns a cursor of the following structure:
The commands supported by the sample database are startwith "select " and startwith "update ". This is it: 2 hardcoded commands, no args or anything...
- The select command returns always the following resultset hardcoded in code:
- The update command simply alters the (2,2) cell of the above table.
0 comments:
Post a Comment
Post a comment