SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to read username and password from web.config file.

Username,password will be stored in custom tags of web.config file of sharepoint project.

share|improve this question

Ouch - don't do this! Use the Secure Store Service to map user credentials. It is designed to store and map credentials in a very secure way.

share|improve this answer

its simple, check this out on msdn it explains it really simply:

but this shouldnt store a user ID/Password ;) that should be kept in AD(active Directory)

if its for a webpart to connect like to K2 server or SQL then its fine:

reading connection string:

Read app settings from web.config

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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