Hi everyone,
I'm n00wbie to C# and I I have one question.
I'm writting class for access to MySQL over DbLinq and I need to know connection string. I know that I can read connection string from webconfig file. My question is is there any function in C# that I can use during runtime to get answer for connection string independent of that I'm executing web application or desktop application (read from appconfig) ????
borkoBorule
0
Newbie Poster
Recommended Answers
Jump to PostI'm not sure I get the nature of the question.
You can certainly use the exact same code to retrieve the connection string in either a desktop or web scenario.
ConfigurationManager.ConnectionStrings["name_here"].ConnectionString
will retrieve the information you need, whether it be in web or app.config. You will probably need to …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.