none
TableAdapter wizard with custom data provider? RRS feed

  • Question

  • We are trying to solve the following problem as quickly as possible:

     

    1. We really want to use the TableAdapter wizard in VS.NET 2005.

    2. We have a SQL 2005 database with tables and stored procedures we will use.

    3. We plan to use typed datasets and the tableadapters from the UI.

    4. Have a crazy constraint. The client applicaton will not actually access the database directly. It will use an application server that is already built. The application server has a single methed the client can use to pass in a SQL statement and parameters, and returns the results in a dataset.

     

    We have been brainstorming possible solutions:

    1. Use reflection to "copy" the tableadapters etc. that are generated and then re-emit the code but replace the actual calls to SQL Server with calls to this app server. This could be a big hassle to create, maintain, and integrate into our development process.

    2. Create our own data provider that uses the appserver by implementing the IDb* interfaces. We are not sure what all will be required to do this, much less what would be required to get it to show up in the UI, and if the TableAdapter would use it automatically or not, etc... plus we would probably lose all the SQL-Server-specific typing that the Sql* provider has.

    3. Create our own OLE DB driver that wraps the appserver and use that. We would lose the SQL-specific typing but at least we know we could use TableAdapter wizards. But we don't really want to create a new OLEDB driver for this and it probably will have its own pitfalls later.

    4. Using partial classes to add additional Fill2, Update2, etc methods that use the command objeccts that were created but pass the info the appserver instead of to a SQL connection. Some of the same issues exist as with #1 above. We would have to use reflection to find out which index the command array a given command used. And how would we generate these methods etc.

    5. Any other ideas? (Given the constraint of using this appserver)

     

    Is there a document that gives more insight into how the Table Adapter wizard works and if/how we can customize what it does?

    Friday, November 30, 2007 5:18 PM