Reputation: 762
Do you know which module in VB.net will allow me to connect to a file (mdf/mdb
) and SQL Server (not at the same time but to change in runtime).
Or do you know of two modules which have the same API?
I'm building software which I will wont work both locally and on a server. But I don't want to have to go changing all of my code just because I'm using a different modules. I know VB.net, but I've never used databases.
There's so many different database connectors its confusing!
Thank you, answers and comments are much appreciated!
Upvotes: 0
Views: 1264
Reputation: 43743
The System.Data namespace provides base classes that can work against any supported data source via ADO. You could connect to both SQL and MDB with the OleDb provider, but it would be much faster if you used the native SqlClient provider when accessing SQL Server. You may find the DbProviderFactories class very helpful:
http://msdn.microsoft.com/en-us/library/dd0w4a2z.aspx
Upvotes: 1