Monday 15 June 2015

visual studio 2010 - C# linq to sql access app.config file -


I have a linq running for the CLL problem, in which the C # 2010 Windows application occurs when it is converted to DLL and other applications. The purpose of calling code as DLL is for the reasons of performance and many applications have to share the code.

When the application is in itself, it runs fine.

Actually when linq was pulled to sql on the desktop, a basic linq was setup by a net structure for the SQL connection. Though i system * .designer.cs is changed to use the configuration namespace, a reference is added to the System.configuration namespace, and the default link in the app.config file to use the back up database connection is changed to the SQL connection . I have removed any referring to the default database connections in the 'property' or 'settings' section for each project file folder.

The problem now is that the .NET framework by resetting default settings value to the database. The inclination value in the app.config file is no longer being used.

Can you show me the code, point me in a context, and / or tell me how can I create this app in connection string values ​​in App.config file again?

A DLL is run in the context of the application it calls. It is not an application in itself, so it is useless to give an app.config file. The configuration settings used by DLL are given by the .config file of the calling application (this can be an app.config file or a web.config file). In your case, the database connection must be defined in your .config file in any application that uses DLL.

No comments:

Post a Comment