Hi,
I normally store all my configs in the registry. Even though I have started using LINQ I would not like to have the DSN in the web.config, but rather let it stay in the registry and attach it (maybe in the Application Start Event) to the System Config.
How can this be done?
Thanx for any ideas!
edit: to make it clear: I do not want to write to the web.config file, I just want to keep the dsn (encrypted) anywhere else than the web.config, so I have the same web.config on all development stages (local, staginf, live, backup).
Christoph
Solution Code in VB.Net:
1) Add a new Class, with one method, which inherits from the original Datacontext:
Public Class MyDatabaseDataContext
Inherits DatabaseDataContext
Public Sub New()
MyBase.New(Settings.DSN)
End Sub
End Class
2) Use this Class in all Linq Datasources instead of the original Context.
ContextTypeName="MyProject.MyDatabaseDataContext