Geeks With Blogs

News FAQ on the correct forum to post at: http://forums.asp.net/p/1337412/2699239.aspx#2699239
Tatworth

When debugging it is useful to display the connection string but what you do not want is to disclose the password. So I wrote a function StripConnectionPassword to strip the connection string of any password.

The function takes a string like:

Provider=SQLOLEDB.1;Password=DINGBAT;Persist Security Info=True;User ID=DINGBAT;Initial Catalog=tempdb;Data Source=DALET

and returns:

Provider=SQLOLEDB.1;Password=...;Persist Security Info=True;User ID=DINGBAT;Initial Catalog=tempdb;Data Source=DALET

The function can be downloaded as part of the CommonData and CommonFilter projects from CodePlex.

Posted on Wednesday, May 25, 2011 8:09 PM | Back to top


Comments on this post: Stripping password from a connection string.

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © TATWORTH | Powered by: GeeksWithBlogs.net