Solved

Sql Server Connection String dropping Pwd

Posted on 2009-05-19
7
467 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
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

734 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