Solved

Sql Server Connection String dropping Pwd

Posted on 2009-05-19
7
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

627 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