I have a custom web part which has a db connection string. It works fine for a while after deploying but suddenly begins to don't show any data. When I edit the page via UI, I see that db connection string is empty. Setting up the connection string fixes the problem.

What could be the reason for that disappearing issue?

1 Answer 1


I don't know exact issue of your problem. But I will recommended you to use Property Bag of Web object to store connection string and get from it in Web Part.. So you will be sure to get connection string in any condition.. I am sharing here a link which will give you a basic idea to add property in property bag and get it from anywhere using SPWeb object..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.