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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaimin ShethiyaPosted Sep 26, 2019, 4:39 AM
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