Loading a typed data set from multiple connections RRS feed

  • Question

  • As far as I understand, one of the points in separating DataSets from adapters is to allow users to access data stored in different formats. For example, a particular set of data might be stored in SQLServer or Oracle. Or, it might dumped to flatfiles, or exported as XML. In all of these scenarios, the dataset definition should remain the same.

    I'd like to be able to provide different adapters for a data set that each use different connections to get at the underlying data. I am able to change the connection for the single adapter, but then I lose the previous select configuration. I'd like to have an adapter for XML, flat files, SQL, and Oracle all pointing at the same typed data set defintion, and all available to me at runtime.

    However, I can't figure out how to do this using the data set designer in VS. Anyone tried to do this sort of thing before?

    Thursday, July 19, 2007 2:03 AM


  • I do not think you could do it with the designer, just because it will regenerate the code each time you change it and does not support multiple DataAdapters. But you could do it writing your own code. You can declare multiple DataAdapters in your code and call appropriate one when you need to get data from specific provider.

    Thursday, July 19, 2007 10:39 AM