Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sql Server Connection String dropping Pwd

Posted on 2009-05-19
7
Medium Priority
?
493 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 150 total points
ID: 24420877
should it not be password=<PASSWORD>  not Pwd=<PASSWORD>
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 450 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Assisted Solution

by:RamanaChoudary
RamanaChoudary earned 150 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

886 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