dakota97
Well-known member
Hi all,
Is there a way that you can allow you a form to connect to multiple database types by creating a separate database class in C#?
What Im aiming to do is create a data class that has the connection information for both an OleDb and SQL database connection. I want to be able to allow a form to connect to the appropriate database type based on the information that is included in the data class. For example, I have 2 separate projects in my solution. The first project is my Windows Application. The second is a class library. My library includes a data class, and in the data class I have a public string property that returns the type of database that is being used. Then, I would like the form to have the ability to open the correct type of connection to the database, based on the value that is returned from the property.
My main reason for this is due to the fact that later on, if I decide to change the database type, I could edit the data class, and send out an updated class library without having to go through and package up the entire application. Any suggestions would be appreciated.
Thanks in advance,
Chris
Is there a way that you can allow you a form to connect to multiple database types by creating a separate database class in C#?
What Im aiming to do is create a data class that has the connection information for both an OleDb and SQL database connection. I want to be able to allow a form to connect to the appropriate database type based on the information that is included in the data class. For example, I have 2 separate projects in my solution. The first project is my Windows Application. The second is a class library. My library includes a data class, and in the data class I have a public string property that returns the type of database that is being used. Then, I would like the form to have the ability to open the correct type of connection to the database, based on the value that is returned from the property.
My main reason for this is due to the fact that later on, if I decide to change the database type, I could edit the data class, and send out an updated class library without having to go through and package up the entire application. Any suggestions would be appreciated.
Thanks in advance,
Chris