Skip to content
Advertisement

Tag: app-config

How can I connect C# with Db with App.config?

I need to connect C# with SQL Server database using app.config. My code is: and in app.config I have: but I get an error and I can’t fix it: ConfigurationErrorExeption was Unhandled Configuration system failed to initialize Can anyone help me please ? Answer Try: You’re referencing Conn as the connection string name but referenced it as Test1 in the

Accessing database connection string using app.config in C# winform

I can’t seem to be able to access the app.config database connection string in my c# winforms app. app.config code C# code: When I try the C# code, I get a message: Warning 1 ‘System.Configuration.ConfigurationSettings.AppSettings’ is obsolete: ‘ This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings’ However, when I try to use: I get an error: Only assignment,

Advertisement