Error while running the published website on IIS 7.5 - asp.net

I have an asp.net website which is developed in asp.net 4.0 with data binding from a database which is maintain in sql server 2000..
It it working fine on localhost but when I am deploying it on IIS and while running the page following error is occurring.
Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.
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.OleDb.OleDbException: Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.
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.
I am using mixed mode authentication and sql server 2008 is installed
on my system
I am using the following connection string in my .cs
page
using (OleDbConnection con3 = new OleDbConnection("Provider=SQLOLEDB;Data Source=sbs;User ID=testuser;Passwrd=pinkCITY01;Initial Catalog=PCGnet"))

try adding Integrated Security=SSPI to connection string
or refer below link
Login Failed 'sa'

Related

Request Timeout Exception Post DNN8 Upgrade

We are in the process of upgrading our website from DNN 7.4.0 to DNN 8.0.3. After I run the upgrade installation and try to access the site, I get error 500.22 dealing with IIS Integrated Mode compatibility. This turned out to be some issues with the new web.config which I resolved.
However, now when I try to access the site with the new config file I get a seemingly infinite compile time. No matter what I set the maximum request time value to, it runs for that long and then I get the following request timeout exception:
Server Error in '/' Application.
Request timed out.
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.Web.HttpException: Request timed out.
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:
[HttpException (0x80004005): Request timed out.]
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0
Does anyone have any idea what causes this, or even where to begin troubleshooting? Any suggestions are appreciated. Thanks,
Henry

Access Denied Error on IIS

i have created a web site on IIS 7.5 which using 91 port on a local server(ip:192.168.0.50) and i am using framework 4.5. When i try to display my web site on browser, html files comes normally but aspx files(which have also sql connenction) doesn't. And it gives error as below. I also gave the Administrator permission to the releated path and when i tested the settings, Authentication and Authorization comes ok. So you guys have any solution? Thanks.
Error:
Server Error in '/' Application. Access is denied 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.ComponentModel.Win32Exception: Access is
denied
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:
[Win32Exception (0x80004005): Access is denied]
[SqlException (0x80131904): A network-related or instance-specific
error occurred while establishing a connection to SQL Server. The
server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote
connections. (provider: Named Pipes Provider, error: 40 - Could not
open a connection to SQL Server)]

SqlException (0x80131904): Login failed for user 'db123'

I get this error when I upload the website on the server, ie parallels plesk server. I create the tables on the plesk server and selects SQL server 2012. But I think this is a connection string error. If you know about this error please guide me.
Server Error in '/' Application.
Login failed for user 'db123'.
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 'db123'.
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.
The Error say you are trying to connect to SQL Server with user db123 which is not exists or exists but you provide wrong password.
To fix the problem
check if the db123 login exists on your SQL Server from plesk panel and is exists in your database users
Open your web.config file to find the connection string section and see the passwrod, then check if the password of db123 login is the same or not
Try connect to you SQL server (on host) from your local SQL Server Management Studio with the user and password which is provided in your web.config to see that everything is fine or not
The problem definitely is from the login credentials. But check to see if you are using Windows authentication.
If you used a default instance during the installation of SQL Server Express, then in the connection string at web.config, clear the username and password portion and set integrated security to true. That worked for me.
With my problem, the SQL server login panel had a user name, but since I was using the default instance, ASP.net did not recognize the username as a valid one even though in principle it was supposed to work. So check integrated security and set it to true. It might work for you

failed due to the following error: 80070005

Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.
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.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 23: public partial class Report_Agent_Commission : System.Web.UI.Page
Line 24: {
Line 25: ReportDocument obj = new ReportDocument();
Line 26: CrystalClass CCobj = new CrystalClass();
Line 27: static string repFile = string.Empty;
Source File:
d:\inetpub\vhosts\impactwebclients.com\httpdocs\Report_Agent_Commission.aspx.cs
Line: 25
Stack Trace:
[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.] CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +207 [TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.] CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0 PBS.GUI.Report_Agent_Commission..ctor() in d:\inetpub\vhosts\impactwebclients.com\httpdocs\Report_Agent_Commission.aspx.cs:25 ASP.report_agent_commission_aspx..ctor() in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\9b53e041\44708862\App_Web_report_agent_commission.aspx
This problem I am getting when using crystal reports 2008 version 10.5.3700.0, if I comment/delete the crystal report content on that particular webpage it is working fine. When I place a crystal reportviewer in the current web page it is showing error
Can you please help me out from here
i found a answer my self.. please place custom error mode on in webconfig
and check the error status number, 99% it gives error no :500 -- that is a internal server
error, on the server machine there is problem
problem may be they has to instal crystal reports runtime or else may be any other problem
so it is not on your coding part so raise a complaint to them after confirming 500 error
thanks all if it is usefull to anybody.. it would be great

Security issue accessing microsoft interop dll sending email

We have a simple piece of code here that recently stopped working and I have tried many 'things' to try and resolve the error.
The code
Application outLook = new Application(); :)
The error
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80070005. 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.UnauthorizedAccessException: Retrieving the
COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80070005.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request
identity. ASP.NET has a base process identity (typically
{MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
the application is not impersonating. If the application is
impersonating via , the identity will be
the anonymous user (typically IUSR_MACHINENAME) or the authenticated
request user.
To grant ASP.NET access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add
the appropriate user or group. Highlight the ASP.NET account, and
check the boxes for the desired access.
Now whilst the error is quite obvious I cannot resolve it.
The application is a .net 2.0 web application and the server is windows 2008 r2 standard using IIS 7.0
Thanks
Using Client appliactions on a server is always going to be problematic - there are other ways to access mailboxes.
That said, this might help:
http://technoblogy.net/retrieving-the-com-class-factory-for-component-with-clsid-00024500-0000-0000-c000-000000000046-failed-due-to-the-following-error-80040154/

Resources