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

G

Guest

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(TransactionEndDelegate cb) +11
System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
ctrl, IntPtr SID) +260

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object 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.cs: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
 
K

Karl Seguin [MVP]

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 said:
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(TransactionEndDelegate cb)
+11
System.Data.SqlClient.ConnectionPool..ctor(DefaultPoolControl ctrl) +797
System.Data.SqlClient.PoolManager.FindOrCreatePool(DefaultPoolControl
ctrl, IntPtr SID) +260

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString
options, Boolean& isInTransaction) +358
System.Data.SqlClient.SqlConnection.Open() +384
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(Object 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.cs: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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top