473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

asp.net 1.1 can't connect to any sql server

Hi,

My asp.net can't connect to any sql database when running 1.1
I can connect to databases if I make a windows application and if if I run
asp.net 2.0
Other computers have no problem connecting to my database

I have not seen descriptions of similar errors when searching the web

I have tried to reinstall and remove/install
-iis
-.net 1.1
-.net 2.0
-visual studio 2003
I get the following error

Exception Details: System.UnauthorizedAccessException: Access is denied.

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 write 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.

Stack Trace:
[UnauthorizedAccessException: Access is denied.]
System.EnterpriseServices.Platform.Initialize() +503
System.EnterpriseServices.ResourcePool..ctor(Trans actionEndDelegate cb) +11
System.Data.SqlClient.ConnectionPool..ctor(Default PoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool (DefaultPoolControl
ctrl, IntPtr SID) +260

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\webapplication1\webform1.aspx.c s:27
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
I will be infinitly greatfull for help that can solve this strange problem

Best regards,

Per Jørgensen
Jul 20 '06 #1
1 1714
If you don't turn impersonation on, all requests made to asp.net run under
those accounts ({MACHINE}\ASPNET for IIS5 and Network Service for IIS 6).

If your connection string is set to use a trusted connection (or integrated
security), it'll try to connect to the database as the person making the
request (in this case one of the two accounts).

There are 3 solutions to fix the problem:

1 -
Grant the account used to run asp.net access to your sql server (done via
Enterprise Manager)

2 -
Turn on impersonation (only good if it's an intranet site where everyone has
a domain account). You need to know what you are doing, this will have other
side effects.

3 -
Use SQL Server authentication. Create a new SQL Server account and change
your connection string to make use of it. This is by far my preferred and
likely most common way of connecting to a database.

Karl

--
http://www.openmymind.net/
http://www.codebetter.com/
"perjorgen" <pe*******@discussions.microsoft.comwrote in message
news:2C**********************************@microsof t.com...
Hi,

My asp.net can't connect to any sql database when running 1.1
I can connect to databases if I make a windows application and if if I run
asp.net 2.0
Other computers have no problem connecting to my database

I have not seen descriptions of similar errors when searching the web

I have tried to reinstall and remove/install
-iis
-.net 1.1
-.net 2.0
-visual studio 2003
I get the following error

Exception Details: System.UnauthorizedAccessException: Access is denied.

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 write 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.

Stack Trace:
[UnauthorizedAccessException: Access is denied.]
System.EnterpriseServices.Platform.Initialize() +503
System.EnterpriseServices.ResourcePool..ctor(Trans actionEndDelegate cb)
+11
System.Data.SqlClient.ConnectionPool..ctor(Default PoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool (DefaultPoolControl
ctrl, IntPtr SID) +260

System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\webapplication1\webform1.aspx.c s:27
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
I will be infinitly greatfull for help that can solve this strange problem

Best regards,

Per Jørgensen

Jul 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try...
3
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL...
1
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0...
4
by: Emilio | last post by:
Question about Shared Sub Connect(server As , message As ) Why is in square brackets? Is it like Shared Sub Connect(server() As String, message() As String)
2
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to...
1
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all...
3
by: dmcquay | last post by:
Hi, I am setting up MySQL on a development box. I have set it up and can connect from localhost, but I cannot connect from another computer on the network. I have narrowed down the problem...
0
by: Clodoaldo Pinto | last post by:
Can't connect to postgresql server php error log message: PHP Warning: pg_connect() : Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server...
3
by: mbsparrow | last post by:
I have just installed sql server 2005 Express . The Server is running but I can't connect to the Server in Server Management Studio (on the same machine). I am getting the following message: ...
5
by: scorpionbilli | last post by:
Hi, The local mysql server is running on my Macbook. I can access it through the console client: $ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.