VS2008 question about typed dataset
I created a typed dataset, and added additional methods to the adapter. When I created the typed dataset, I used System.Data.SqlClient for the connection. But now, I realized I want to use System.Data.OleDb. Is there a way for me to transfer all the methods that I added in the adapter in the typed dataset that uses the SqlClient connection? (without having to basically do it over?)
Re: VS2008 question about typed dataset
Re: VS2008 question about typed dataset
It's possible you can just open the code file for the typed dataset and do a find & replace on sql to oledb. eg sqlCommand becomes oledbCommand. I would save a backup of the file first and see how it goes.
Re: VS2008 question about typed dataset
Hello,
This highlights one of the main "issues" with ADO.Net. It's great in that you can connect to multiple databases, etc, however, in using the dedicated classes for a particular database, you leave yourself in a position where you can't connect to other back ends without changes to your code.
There is a technique known as the provider model where you can write your code in such a way that you can quickly swap out database backends without the need to change you core code. A great sample application that shows how this can be done is the Beerhouse sample kit:
http://thebeerhouse.codeplex.com/releases/view/127
Gary