Connection string for remote database server

At the moment I have 2 servers installed. One of them is a web server running Win Server 08, and the other is a database server running SQL Server 08 on Win Server 08.

Currently, I have set up my site so that it can read / write to the database using the connection string that I created with the database name, ip server, db user and db pwd. The db user I created has the setting of a "public" role in the database (not the owner of db) and can simply run the exec stored procedures. Currently, the connection string looks like this:

<add name="SiteDBConn" connectionString="Server=IPOfServer;Database=DBname;User ID=userhere;Password=passhere;"/>

While this works fine for me, I would like to set up a database connection string that does not contain a username and password. On some of my other servers, where the SQL server is on the same server as the web files, I can use a reliable connection and use the built-in “Network Service” user in my database. This allows me to run a connection string without a username and password:

<add name="SiteDBConn" connectionString="Server=localhost;Database=DBname;Trusted_Connection=Yes;"/>

Is there an easy way to achieve a database connection without hard coding the username and password - like the above connection string - when using 2 different servers? I spend my time on this route, seeing how the database user I created has all the rights to execute scripts?

Thanks for your thoughts on this.

+5
2

. . IIS SQL , :

  • asp.net IIS, SQL ( )
  • ( , )
  • (brrrr)
  • asp.net .
  • IIS6
+5

Windows, .

, Windows, SQL .

, .

+1

All Articles