Search code examples
.netodbcms-officeoledbexport-to-excel

How to query a .NET 3.5 (C#) application? Is building a custom ODBC (OLE DB) provider the best way?


I've developed an application in C# (.NET 3.5) that collects a lot (e.g. 40 channels, each sampled @ 400 Hz/32 bits per sample for 24 hours) of sample data from various sources. Samples are in the format DateTime/double (x/y) and there may be several million samples per channel. Data are stored in DB4O files.

Now I need to provide an easy way to export data. I've already implemented a simple ASCII file export. Export files are huge, but that's what to expect. However, it would be really nice to provide an easy way to retrieve data from e.g. Office 2007 by "querying" the application. I'm thinking either (1) an Excel add-in, or (2) building an ODBC data provider.

Building an Excel add-in wouldn't be that hard. Some Google-fu and you're done ...

What about option #2? It would enable "any" application to retrieve data the user is interested in. Each signal could be represented as a table with two columns (time and data). The user could use any ODBC-client to query for a given timespan, data would be fetched from the internal data source and returned to the ODBC client. How would one go about implementing such a beast? Or, are there other common data exchange mechanisms I'm missing here.

Thank you for your time!

Mikael


Solution

  • You can use WCF Data Services on an Entity Framework ORM stack to provide a queriable ODATA Data source can can be consumed generically locally and across the web. Specifically with Excels Power Pivot.

    The whole thing should take you about 15 minutes to put together to.