1

I am developing an ASP.NET application in which I need to provide support for two databases, MySql and MS SQL Server 2005 and 2008 (one database will be used at a time).

  1. How will I configure the ASP.NET app to connect with different databases without reinstalling the app (i.e. using configuration)?

  2. How will I configure LINQ?

  3. Shouldn't I use NHibernate?

0

2 Answers 2

1

Use basic Linq to SQL structures (nothing database specific) and by just changing the connection string should do the trick. Linq expression trees are transformed to SQL by Linq enabled drivers (i.e. they know how to handle the expression tree).

Sign up to request clarification or add additional context in comments.

1 Comment

There is a flaw in your suggestion. Linq to SQL (System.Data.Linq) does not support any database except SQL Server. Entity Framework (with a MySql Connector version of 6.x or above) or NHibernate do, though.
0

Here is better way of doing it: Multiple database support with Entity Framework.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.