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

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
 
R

Ryan LaNeve

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top