c# - Switching Database in LinqToSql -


How can we change the underlying database for Linq based WebApp?

For example:

When we leave our web application, the ado Using the net, being released from production, the strong connection string in the web is as simple as configuring to point to the live database. Are there.

Note; using c #

P>

thanks

I will highly recommend the data reference with connection encryption in your app immediately. I will create an auxiliary component which:

  public static class DCHelper {create public static MyDataContext (return new MyDataContext (Configuration Manager Connectivity ["CS"]. ConnectionString);} < / Code> 

In this way, I have only one place in which the reference is referred, or I can change the configuration file to switch the database. Or, to determine the connection .


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -