C# Access of SQL Developer using ASP.NET

T

Thom Little

I am running on Windows XP Professional Service Pack 1 with all Hotfixes
installed. I am the only user of the system.

I installed SQL Server Developer (2000) and want to access the SQL data from
IIS.

I am running on a local machine and its name is AXP. I can run happily if I
directly access SQL telling it to use Windows authentication.

I have a C# Web Service created and when I run a test of it under Visual
Studio .NET 2003 it tells me:

--------
System.Data.SqlClient.SqlException: Login failed for user 'AXP\ASPNET'.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
srcTable)
at Northwind.Customer.GetCustomers(String Country) in
c:\inetpub\wwwroot\northwind\customer.asmx.cs:line 64
--------

I assume that there is something "very basic" that I need to do to set SQL
to permit access by ASP.NET. I also assume that this is not set in the
"basic install" of SQL Server.

Can someone give me a hint on how to resolve this issue? Is there a better
newsgroup for this question then the C# newsgroup?

Thanks.
 
I

ilPostino

If you open enterprise manager for SQL and head for Security you must give
permission to ASPNET to access the database and what tables it can access.

C
 
D

DalePres

You have to specifically add the ASPNET user account to the SQL Server
logins and give the account appropriate access to the SQL Server, i.e.
datawriter, datareader.

Dale
 
T

Thom Little

I enabled it for ASPNET and the application is now running.

You both got me back on track and I am now sufficiently knowledgeable to be
REALLY dangerous.

Thanks for the help.
 
J

Jeffrey Tan[MSFT]

Hi Thom,

I am glad you find what you want.
If you have any further concern, please feel free to tell me, I will work
with you.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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

Top