you might need to add login details to your SQL DB, i.e.
sqlconn = new SqlConnection("server = localhost; database = E-Services; uid=sa;pwd=password; integrated security=true");
Main Topics
Browse All TopicsHi
I have a asp.net website which runs fine when I click play in visual studio.
I have just added it to IIS in order to access it from another machine on the network.
However I get this error when I go to
http://localhost/e-service
Any ideas?
Thanks
H
Server Error in '/E-Services' Application.
--------------------------
Cannot open database "E-Services" requested by the login. The login failed.
Login failed for user 'mymachine\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
Login failed for user 'mymachine\ASPNET'.
Source Error:
Line 18: //define and open sql connection
Line 19: sqlconn = new SqlConnection("server = localhost; database = E-Services; integrated security=true");
Line 20: sqlconn.Open();
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
In SQL SERVER I added
'mymachine\ASPNET'
under
Security
Users
Now the error is
Server Error in '/E-Services' Application.
--------------------------
SELECT permission denied on object 'categories', database 'E-Services', schema 'dbo'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlE
Source Error:
Line 158: SqlDataAdapter dadEServices = new SqlDataAdapter("SELECT * FROM eservices ORDER BY title ASC", sqlconn);
Line 159: DataSet ds = new DataSet();
Line 160: dadCategories.Fill(ds, "categories");
Line 161: dadSectors.Fill(ds, "sectors");
Line 162: dadEServices.Fill(ds, "eservices");
Solution #1:
if you know the password of sa (sql login) then i recommend to use that, if not go:
Server Enterprise Manager --> Security Tab --> Right Click on sa (Server Administrator)---> select properties --> type a new password
sqlconn = new SqlConnection("server = localhost; database = E-Services; uid=sa;pwd=newPassword; integrated security=true");
Solution #2:
Server Enterprise Manager --> Database --> E-Services --> Users --> Right Click --> new Database user --> Select Login Dropdownlist --> select <new> --> type name --> Select SQL server authentication --> type password --> on database select E-Services --> press OK --> you will return to the initial screen --> select all appropriate database membership role
use the new details in your connectionstring:
sqlconn = new SqlConnection("server = localhost; database = E-Services; uid=newDBuser;pwd=newPassw
Hope that helps
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup Zone:
Accept - here4u247 {18763971}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
cj_1969 - Experts Exchange Cleanup Volunteer
Business Accounts
Answer for Membership
by: hmcgeehanPosted on 2007-03-21 at 04:26:54ID: 18762968
BTW I went to SQL SERVER and into my database and ran the command
exec sp_grantlogin 'mymachine\ASPNET'
but still the same error