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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting databse oriented program to work outside of MS Web Developer

Status
Not open for further replies.

ola123

Technical User
Sep 16, 2005
52
JM
I wrote my program in Web developer 2008 and connected to a database [Ms SQL 2008 server]. the program works fine inside Web developer, but how do i get it to work when web developer isn't open.

My real problem is connecting to the database when web developer is not open, i get this error msg [Cannot open database "OpenbibleDb" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.] i installed IIS, ASP.NET[that came with web dev 08] so im not quite sure what else to do

Your input is greatly appreciated as well as any links to tutorials that may help.

Please forgive my lack of knowlegde,
Thanks in Advance
 
I'm not an IIS/ASP.Net expert, but from a 30,000 foot view--what is probably happening is that you're creating an application with a database connection which is relative to the context you are running the application under.

When you develop on your machine, you are most likely connecting to the database with your login. When you deploy it, it will be running under the web server's account.

Typically, developers will user SQL Authentication for ASP.Net applications. This means you store your user name and password for SQL Server either in the code, or in the web.config file. Then, your application will run with the same login credentials regardless if you are debugging in Visual Studio or if the application is deployed. If you don't wish to store a user name and password combo, you can look into impersonating and passing the client's credentials through to the database.
 

In your connection string, if you have 'Integrated Security=SSPI;' you need to change it to 'user id=[userid];password=[password];'. Of course, replace [userid] and [password] with appropriate values.




I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top