Hi,
I need to create a database interface in C# .NET which allows me to intercept any SQL query going out to the database (e.g. from the .NET DataAdapter) and perform certain transformations (rename keywords, modify INSERT- and UPDATE-Commands, etc.) on it before it's actually executed. The problem is, that the interface should be provider independent and transparent, so that the developer working with it need nothing to know about my transformations. Normally that kind of stuff could be done in stored procedures, but not all providers (e.g. Access) support them to the extent I would need it.
I already tried to subclass the generic DbCommand-Object, overriding the CommandText- and Execute...-Methods to put my transformation code there, but unfortunately parts of the .NET-Framework (e.g. the DataAdapter) try to cast the DbCommands into the provider specific commands, which is of course impossible with my own DbCommand subclass.
As I'm at my wits end now, I really would appreciate some help or even a hint to a possible way to solve my problem.
Thanks in advance,
Felix