Solved

Sql Server Connection String dropping Pwd

Posted on 2009-05-19
7
460 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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now