473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SqlConnection.ConnectionString losing password after Open

I have a SqlConnection object that in turn has a ConnectionString property
set that includes a "pwd=password" in it. When I make the call
SqlConnection.Open() and I later try to get the
SqlConnection.ConnectionString, the pwd portion of the string is no longer
there. I'm assuming this is some sort of security issue, but I found it as
odd. What's going on?

Thanks,
Nov 17 '05 #1
1 4556
Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you're trying to get the
ConnectionString from a SqlConnection after Open method is called, the
Password portion is missing. If there is any misunderstanding, please feel
free to let me know.

In this case, I assume that Persist Security Info part is set to false or
using the default value 'false' in your connection string. According to
MSDN document, when it is set to false or no (strongly recommended),
security-sensitive information, such as the password, is not returned as
part of the connection if the connection is open or has ever been in an
open state. This behavior is for security reason.

You can check the following link for more information:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdatasqlclientsqlconnectionclassconnecti onstringtopic.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Muchacki | last post by:
Hello all! I'm fighting with this little problem. I'm trying to retrieve data from a table in SQL Server 2k. I'm dead. The only result I get is retrieving the headers of the columns - no data in...
3
by: Stephen | last post by:
I'm experiencing a strange problem that has me baffled. I created a webservice with a webmethod that connects to a remote MS SQL Server. It works fine when connecting to one server (running SQL...
2
by: MrMike | last post by:
I have a web.config file containing the SQLConnection String to a SQL Database. Before I implemented this SQLConnection String into web.config, I had individual SQLConnection objects in each...
4
by: Nevyn Twyll | last post by:
I've been working on an asp.net application and everything's been great. But suddenly, whether I'm tyring to use a database on my own machine, or on my server, I'm getting a timeout when trying to...
3
by: patang | last post by:
In my VB.Net project when I access an Access database without setting any password, everything works fine. However, when I set the password and use this connectionstring ...
2
by: neodev | last post by:
Hi I have 2 mode for open db 'Path DB Private Const pathDB As String = "C:\...\diabolik.mdb" 'for the ole db Private conn As New OleDbConnection 'for th sqlconnection Private connRS As...
2
by: axel22 | last post by:
Ok here it goes. 1. I've created a new web service project in F:\c#\WebSites\ServisBaze. 2. I've published the web service with IIS in a virtual directory who's actual path is:...
8
by: hoetat | last post by:
When I try to open a connection to the database I hit an error "Object reference not set to an instance of an object." I have make a simple test connection function same error coming out when...
1
by: priyamtheone | last post by:
What's the connectionstring to connect to the Oracle9.0 Database Server irrespective of servername,username and password using VB.Net2002 (.Net framework 1.0)? In case of Microsoft SQL Server the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.