hi guys
Please Support me ,
how can i declare the connectionString of database to a certain project as public refer to all project, now i wrote a connectin to any webform i think this not correct.
Pls help me and i know what Is correct?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Sep 26, 2019, 12:39 AM EDT
If you written common places then need to one constant file for connection string and used everywhere that file.
If you are written everywhere that is tedious but when you have to chnage the server or sql service provider that time you have to again publish your code to changes as per the new connection string. if you are wriiten in web.config file then just only changes in web.config file.
This is the myside opinion, if sql service provider or server not changed in future then you have go to the create a constant file and used that.
Thanks