Database Connection Problem
-
venerdì 27 aprile 2012 07:49
Hello,
I Convert my vb6 project into vb.net 2010. In VB6 i have two database 1.Access and 2.MSSQL
The Design of both database are same and database selection by the client requirement some want access and some want MSSQL. In VB6 Project I just change the connection string and its work for both data base.
Now vb.net 2010 Provide OLEDB, SqlClient. Which one i choose if i choose OLEDB then i am not able to connect MSSQL Database. and If I Choose SqlClient then i am not able to connect MSAccess Database.
I want the both connection of database [At a time one MSSQL OR MSACCESS] by minimum changes.
Art Of Living Is Art Of Giving
Tutte le risposte
-
venerdì 27 aprile 2012 08:03
Hi,
you can check out the DBProviderFacories Class : http://msdn.microsoft.com/en-us/library/system.data.common.dbproviderfactories.aspx and especially the overloaded method GetFactory() : http://msdn.microsoft.com/en-us/library/h508h681.aspx
Hannes
If you have got questions about this, just ask.
In a perfect world,
users would never enter data in the wrong form,
files they choose to open would always exist
and code would never have bugs.
C# to VB.NET: http://www.developerfusion.com/tools/convert/csharp-to-vb/ -
sabato 28 aprile 2012 10:55
Hi Heslacher
Thanks for reply
i want to ask about ODBC can i use this. It Support all type of database connection.
Art Of Living Is Art Of Giving
-
lunedì 30 aprile 2012 05:31
Hi,
sure you can use odbc if the desired odbc driver is installed in your system. For all the connectionstrings you can check out this site:http://www.connectionstrings.com/
Hannes
If you have got questions about this, just ask.
In a perfect world,
users would never enter data in the wrong form,
files they choose to open would always exist
and code would never have bugs.
C# to VB.NET: http://www.developerfusion.com/tools/convert/csharp-to-vb/- Contrassegnato come risposta Pratush Krishna mercoledì 2 maggio 2012 06:00
-
lunedì 30 aprile 2012 05:56
You can with OleDB connect to a MS SQL database, however you loose some performance and things like named parameters
http://www.connectionstrings.com/sql-server-2008#p2
Success
Cor- Contrassegnato come risposta Pratush Krishna mercoledì 2 maggio 2012 06:00

