Windows authentication password in sql connection vs. sql "sa" authentication

  • Thread starter Thread starter Chumley the Walrus
  • Start date Start date
C

Chumley the Walrus

I don't have necessary rights on my local machine at work to use SQL
administrative "sa" and password when utilizing sql connections. My
Windows network username and password does allow me to connect to
local SQL database (MDSE) when I view the database scheme in
visualstudio.net (PROG1\NETSDK ).
When I need to create an sql connection string, :

using System.Data.SqlClient;

string source = "server=(local)\\NetSDK;" +
"uid=QSUser;pwd=QSPassword;" +
"database=marketing";

SqlConnection conn = new SqlConnection(source);
conn.Open();

...how would I specify my windows network username/pwd, opposed to an
sql administrative type shown above?

Thx
Chum
 
Chumley the Walrus said:
I don't have necessary rights on my local machine at work to use SQL
administrative "sa" and password when utilizing sql connections. My
Windows network username and password does allow me to connect to
local SQL database (MDSE) when I view the database scheme in
visualstudio.net (PROG1\NETSDK ).
When I need to create an sql connection string, :

using System.Data.SqlClient;

string source = "server=(local)\\NetSDK;" +
"uid=QSUser;pwd=QSPassword;" +
"database=marketing";

SqlConnection conn = new SqlConnection(source);
conn.Open();

..how would I specify my windows network username/pwd, opposed to an
sql administrative type shown above?

Thx
Chum

string source = "server=(local)\\NetSDK;Integrated
Security=SSPI;Database=Marketing;";

For future needs/reference: www.connectionstrings.com

And by the way, even if you did have access to the "sa" password, you should
never use.

Good luck.

Ryan LaNeve,
MCSD.NET
 
Back
Top