Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Login failed for user 'Domain\MachineName$' asp.net app deployment

Posted on 2004-10-29
7
Medium Priority
?
1,478 Views
Last Modified: 2012-06-21
WILL CROSS POST ON "SQL SERVER" FORUM

Hi,

We are trying to deploy an asp.net app. to a Windows Server 2003 running SQL Server.  When we try to access the DB we receive the following error :-

Login failed for user 'Domain\MachineName$'

We "think" we have set all correct user logins but can't be 100% sure as we cannot find any finite documentation on this and what we have found seems to apply to "NetWork security" users and ASPNET users but nothing relating directly to the machine account.

Any thoughts would be much appreciated.

James.
0
Comment
Question by:JAMES
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Accepted Solution

by:
nauman_ahmed earned 2000 total points
ID: 12442678
James,

You will need to enable both Windows and SQL Server authentication in the SQL Server Properties. After enable that option, you can create a specific database user to connect to the SQL Server. If Windows Authentication is not used in ASP .NET app, then the SQL Server connection is accessed by ASPNET account that has very minimum privileges and under default installation, no permissions at all to access the SQL server. Visit http://www.connectionstrings.com to learn more about the connection string format.

Best, Nauman.
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 12442684
Here is an example from connectionstrings.com web site:

Standard Security:

"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
   - or -
"Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
   (booth connection strings produces the same result)




 Trusted Connection:

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
   - or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
   (booth connection strings produces the same result)

(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
 Connect via an IP address:

"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
 Declare the SqlConnection:

C#:
using System.Data.SqlClient;
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString="my connectionstring";
oSQLConn.Open();



VB.NET:
Imports System.Data.SqlClient
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString="my connectionstring"
oSQLConn.Open()

HTH, Nauman.
0
 

Author Comment

by:JAMES
ID: 12442789
Nauman,

I will check the link out and report back...

Here is our connection string - is this wrong?

workstation id="JAMES-X31";packet size=4096;user id=sa;data source=R2D2;persist security info=True;initial catalog=Reality;password=MyPassword

Where R2D2 is the IIS6 / DB Server and JAMES-X31 is the development machine (does this matter).

Thanks.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Expert Comment

by:AerosSaga
ID: 12443329
Standard Security:
"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
   - or -
"Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"

Aeros
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 12443867
I use the following connectionstring to connect to SQL server:

Data Source=192.168.0.2,1433;Network Library=DBMSSOCN;Initial Catalog=Northwind;User ID=sa;Password=password;

Best, Nauman.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 12444588
Login failed for user 'Domain\MachineName$'

shouldn't it be Domain\USER???
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12462801
what kind of authentication is specified for ur web application ... i.e. anonymous, basic, windows etc ..

u will need to impersonate the current user .. so u have to add the tag in the web.config file ..

<system.web>
    <identity impersonate="true"/>
......


check out this link .. explanation in detail ..

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetAP05.asp
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question