kjones1876
kjones1876

Reputation: 762

What database module in VB.net will allow me to connect to both SQL Server and a MDF file?

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

Answers (1)

Steven Doggart
Steven Doggart

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

Related Questions