Hi All,
I have to create a connection string which i can use in all the pages.I do not want to write connection strings codes in all the pages.
Please help
Loading
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.
CrishPosted Nov 30, 2010, 5:02 AM
To come out this issue you can create just one class.
In this class you can create one method of connection(with any name) and just pass the connection string .
then you can call this method in every pages in page load event .. so there is no need to create a connection string which you can use in all the pages.
You should pass connection string only one time and use it in every pages using call that method.
Also you can set connection string in web.config file.
Hirendra SisodiyaPosted Nov 23, 2010, 2:03 AM
thanks
Jiteendra SampathiraoPosted Nov 19, 2010, 5:40 AM