•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 391,566 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,621 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 1363 | Replies: 4
![]() |
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
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.
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.
•
•
Join Date: Nov 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
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 ?
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 ?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
Other Threads in the C# Forum
- Previous Thread: c# connection to microsoft access DB
- Next Thread: C# code to write in a doc file


Linear Mode