Question : Crystal Report in ASP web app Error Login failed for user 'MYDOMAIN\username'.

Hi all,

I created a crystal report and deployed it to a test server, i call it from my web application by clicking on a button, when I do I get an error on the page (See Attached)

The thing that confuses me is I tried logging into the database using the same user and I was able to!!!  is something wrong with permissions or my connection string?

Connection string looks like this:

Conn.ConnectionString = "Data Source=servername;Initial Catalog=xxxxxx;Integrated Security=False;user id=MYDOMAIN\\username;password=sssssss;";
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Server Error in '/APP' Application.
--------------------------------------------------------------------------------

Login failed for user 'MYDOMAIN\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 'MYDOMAIN\username'.

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.  

Stack Trace: 


[SqlException (0x80131904): Login failed for user 'MYDOMAIN\username'.]
   MYReports._Default.Page_Load(Object sender, EventArgs e) in C:\Users\saa\Documents\Visual Studio 2008\Projects\APP\MYReports\Report.aspx.cs:35
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

Answer : Crystal Report in ASP web app Error Login failed for user 'MYDOMAIN\username'.

I wouldn't attempt to combine both triggers and the use of a data layer such as nhibernate - you're always going to get synchronisation problems. nHibernate is intended to manage your data - and your business layer should manage processes such as updating your prices. Personally I don't go near triggers for any business logic - for auditing perhaps, but nothing else. I think they obscure business logic and make it nigh on impossible to implement other code solutions for managing the data - as you are finding.
Why not move your trigger code into a stored procedure and call the procedure from within the transaction scope of the update if the 'finished' flag is true? I would manage this within the business layer, but you could move this to the data layer if you wish.

Tim
Random Solutions  
 
programming4us programming4us