Solved

Sql Server Connection String dropping Pwd

Posted on 2009-05-19
7
465 Views
Last Modified: 2012-05-07
Hi Thanks for clicking,

We have this issue. We are trying to connect to SQL server uing the code show.

However it keeps dropping the Pwd="Password" in the ConnectionString when I check it in the debugger

Can anyone help??

It simply returns "MultipleActiveResultSets=True;Data Source=" & strSQLServerName & ";Initial Catalog=trackerSQL;Integrated Security=False;User ID=sa;"

and drops the Pwd bit
Dim strConnectionString As String = "MultipleActiveResultSets=True;Data Source=" & strSQLServerName & ";Initial Catalog=trackerSQL;Integrated Security=False;User ID=sa;Pwd=password"
cnnSQL = New System.Data.SqlClient.SqlConnection()
cnnSQL.ConnectionString = strConnectionString

Open in new window

0
Comment
Question by:StuartK
7 Comments
 
LVL 16

Assisted Solution

by:Wadski
Wadski earned 50 total points
ID: 24420877
should it not be password=<PASSWORD>  not Pwd=<PASSWORD>
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 150 total points
ID: 24421890
Wadski:  It depends on the provider.

But yes, for System.Data.SqlClient.SqlConnection it should be:

Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;

As referenced from:
http://www.connectionstrings.com/sql-server-2005
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 24421910
Wadski was probably answering because they looked at the connection type you were building.  I wasn't attempting to correct them, rather make the point that it's not ALWAYS "Password=...".  For example, making the connection with the SQL Native Client provider uses "Pwd=....".
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 4

Assisted Solution

by:RamanaChoudary
RamanaChoudary earned 50 total points
ID: 24423123
here all the connection strings..

http://www.connectionstrings.com/sql-server-2005
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 24425976
Yes Ramana... that is the same URL I posted.
0
 
LVL 4

Expert Comment

by:RamanaChoudary
ID: 24426278
opps ...
sorry brother... i did not see..
0
 

Author Comment

by:StuartK
ID: 24481900
Guys thanks for your feedback.
Its drops the password for encruption reasons I believe, so is acting as it should.
 
However, appreciate any feedback in resolving, and for that reason will allocate the points.
Thanks guys.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question