Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connectionstring with integrated security

Status
Not open for further replies.

Olavxxx

Programmer
Sep 21, 2004
1,134
NO
Hi,

I develop in vs.net 2005, but when porting the website to the live enviorment, the sql server suddenly is no longer a local file, but it's on another server in the park.

When I use this code (in the Web.config):
Code:
	    <add name="connString" connectionString="Network Library=DBMSSOCN;Data Source=xxx.xxx.xxx.xxx,1433;Initial Catalog=myDataBaseName.mdf;Integrated Security=SSPI"
      providerName="System.Data.SqlClient" />

What happends then, is that I get an msg-box:
"Login failed for user 'USERNAME\COMPUTERNAME$'"

I also tried making a user in the sql db and giving it permissions to the db and then I tried with this code:
Code:
	    <add name="connString" connectionString="Network Library=DBMSSOCN;Data Source=xxx.xxx.xxx.xxx,1433;Initial Catalog=myDataBaseName.mdf;User ID=myDataBaseUser;Password=myDataBasePassword"
      providerName="System.Data.SqlClient" />

However, that code did not work, due to the fact that "mixed mode" authentification is not allowed in the sql server.

Should I use the windows authentification or should I use the "mixed mode"? Also, can I change the user it will try to authenticate with, as it in the first sample tries with one user that does not authenticate with the sql server on the remote server.

Olav Alexander Mjelde
Admin & Webmaster
 
Re the integrated security bit..
this will only work if both systems are on the same domain.

so.. if you are not.. Mixed mode is your option.

Otherwise if you are.. you can have your webserver "impersonate" a network user or use the internet/guest account to login (usually aspnet or IUSRmachineName)


HTH

ROb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top