1
Answer

C# linq to sql problem-want to use values in app.config file

scampercat

scampercat

11y
1.5k
1
I am having a linq to sql problem with a C# 2010 windows form application when it is changed to a dll and accessed by other applications. The purpose of the calling the code as a dll is for performance reasons and to share the code accross multiple applications.

When the application is on its own, it runs fine.

Basically when the linq to sql was dragged to the desktop, a default linq to sql connection was setup by the .net framework. However I changed the *.designer.cs  to use the system.configuration namespace,
added a reference to the system.configuration namespace, and changed the default linq to sql connection to use the database connection obttained in app.config file. I also removed any refernces to the default database connections in the the 'properties or 'settings' section for each project file folder.

Now the problem is the default setting values to the database are reset by the .net framework. Thwe values in the app.config file are no longer being used.

Can you show me code, point me to a reference, and/or tell how I can make this application is the connection string values in the app.config file again?
Answers (1)