Hi,

I have created a Crystal Report Viewer. When compiled on my machine it works fine. However, earlier this week I had to make a copy onto a server. When doing this I had encountered several problems that I maanged to solve...except for one :o(.

No matter what I try I still get the following error..."Login failed for user 'STS-SYNMAC\userName'".

Login failed for user 'STS-SYNMAC\userName'.
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 'STS-SYNMAC\userName'.


Source Error:


Line 70:             try
Line 71:             {
Line 72:                 conn.Open();
Line 73:                 /*===Creating an SqlCommand object for the established connection &
Line 74:                  executing the data reader using the SqlDataReader===*/



Source File: c:\Inetpub\wwwroot\OTReports\RViewer.aspx.cs    Line: 72


Stack Trace:


[SqlException (0x80131904): Login failed for user 'STS-SYNMAC\userName'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.Attemp


ETC..


In my config file, I have tried the following but nothing seems to work...


<?xml version="1.0"?>
<!--
-->
<configuration>
<!--<system.web>
<pages enableEventValidation="false"/>
<compilation debug="true"/>
</system.web>-->


<appSettings>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" /><add key="ConnectionString" value="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" />


<!--<add name="ConnectionString" connectionString="Data Source=SVRSQL35;User ID=STS-SYNMAC\userName;Password=pass07;database=OTReports" providerName="System.Data.SqlClient"/>-->


<add key ="ConnectionString" value="Persist Security Info=False;Connection Timeout=20;database=OTReports;server=SVRSQL35;User Id=STS-SYNMAC\userName;Password=pass07"/>


<!--<add key ="ConnectionString" value="Persist Security Info=False;Connection Timeout=20;database=OTReports;server=SVRSQL35;User Id=STS-SYNMAC\userName;Password=pass07"/>-->


<!--<add key="ConnectionString" value="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True;User Id=STS-SYNMAC\userName;password=pass07"/>-->


</appSettings>
<connectionStrings>
<add name="OTReportsConnectionString" connectionString="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="OTReportsConnectionString2" connectionString="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="OTReportsConnectionString3" connectionString="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="OTReportsConnectionString4" connectionString="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="OTReportsConnectionString5" connectionString="Data Source=SVRSQL35;Initial Catalog=OTReports;Integrated Security=True" providerName="System.Data.SqlClient"/>
<system.web>
ETC..

I am so desperate for help because I really dont know what I am doing...
Any help given would be apreciated.

Thank you in advance

This error occurs simply because you do not have a user established on that SQL server with that name. If the user is Windows Authenticated, then it will use the logged in user name and domain [domain]\[logged in user name]. If "STS-SYNMAC\userName" is not a valid user in that domain, and that domain is allowed on that SQL server, then you will get the error.

If using SQL Authentication, then you will have to first make sure the SQL server allows that option, and make sure you have a user with that name.

Hi,

The user is Windows Authenticated, and is a valid user...
but for some reason...it still doesnt allow me to connect.
I have tested to see if the user is valid by connecting to a remote desktop and everything seems fine on there...

When running the program off my machine locally I ercounter no problems...however, since i made a copy to one of our terminal servers and this is where i am getting the error...

I defo think something is wrong with my ConnectionStrings...?

Could you possibly suggest anything??

Many Thanks

Okay, this web server is connecting to an SQL Server. Is the SQL Server on the same machine as the WebServer ?
If so, is the SQL Server part of the same domain as the WebServer ? And is that Domain named "STS-SYNMAC" ? and do you have the SQL Server setup to authenticate users of that domain ?, and is the "userName" Windows account valid in that domain ?
Use SQL Studio to explicity allow this Domain\Account, and give it rights to the OReports catalog.

This is purely an authentication problem on that server. Can you launch a Windows App on that server, and see if it can connect to the SQL server ?

I guess that u should give set the user and password doing so :

ReportDocument.SetDatabaseLogon("user", "password");
The ReportDocument is your crystal report object in the new empalcement

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.