Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I just added a ASP.NET web project to my 2003 server that has IIS 6.0. I add a Virtual Directory and everything works so far. When I browse to the VD it comes up with the login page I made so I login using the username and password that is in the SQL database of the project and I get this error:

CSS
Login failed for user 'MASTER-PC\COCWEB$'.
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.SqlException: Login failed for user 'MASTER-PC\COCWEB$'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


What did I do wrong? Will this happen every when I make a link on the current web site to connect users to the newapp site for them to login? Whatis the best way to fix this? This will part of the current website that I have up already. So I have it as: www.newdeal.com/newapp.

C#
<configuration>
  <connectionstrings>
    <add name="PasswordConnectionString" connectionstring="Data Source=COCSQL;Initial Catalog=Password;Integrated Security=True" providername="System.Data.SqlClient"></add>
  </connectionstrings></configuration>
Posted
Updated 20-Sep-13 7:55am
v3

1 solution

It is saying that you can't login to SQL using the account MASTER-PC\COCWEB$. You just need to use an account that has permissions.
 
Share this answer
 
Comments
Computer Wiz99 20-Sep-13 13:28pm    
RyanDev, do you think it will work if I add MASTER-PC\COCWEB to the SQL server as a user?
ZurdoDev 20-Sep-13 13:41pm    
Yes. Whatever is in your web.config (I assume you are using one).
Computer Wiz99 20-Sep-13 13:44pm    
Ok, Thanks. One more question, I have over 5000 users that is going to use this system. They can connect to it through my current website. Is there a way to set them up without inputting all of them?
ZurdoDev 20-Sep-13 13:50pm    
In web.config you should have a connection string and in that connection string will be a username and password. Any Sql code that you write should use that connection string so that all Sql access uses that same account. That is how most websites will work.
Computer Wiz99 20-Sep-13 13:53pm    
Ok. Can you show me an example so I will know that I am on the right page with you in web.config? What should that connection look like? This is what I have: (Code in Improve Question).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900