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

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.
JAMESAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nauman_ahmedCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nauman_ahmedCommented:
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
JAMESAuthor Commented:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

AerosSagaCommented:
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
nauman_ahmedCommented:
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
AerosSagaCommented:
Login failed for user 'Domain\MachineName$'

shouldn't it be Domain\USER???
0
RejojohnyCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.