B
BLUE
I'm using SQL Server 2005 Developer Edition on Windows XP SP2 with this
setting:
<add name="SqlServerTrustedConn"
providerName="System.Data.SqlClient"
connectionString="Data Source=localhost;Initial
Catalog=GTSDB;Integrated Security=SSPI;" />
All worked great with my windows application.
Now I've copied the DAL of the windows application into a Web Service
project and when I open a connection I get the following exception:
Cannot open database "GTSDB" requested by the login. The login failed.
Login failed for user 'PCNAME\ASPNET'.
Since remote connections are disabled by default I've used the Surface Area
Configuration tool to enable them.
Then I've created a SQL login for the ASPNET account:
CREATE LOGIN [PCNAME\ASPNET] FROM WINDOWS
Since it didn't work I deleted the SQL login for the ASPNET account:
DROP LOGIN [PCNAME\ASPNET]
I've determined that PCNAME\WINDOWSUSER is the database owner:
select suser_sname(owner_sid) from sys.databases where name = 'GTSDB'
I've verified that 'sa' is the database owner according to the information
stored in the database itself:
select suser_sname(sid) from sysusers where uid = user_id('dbo')
I've found that the PCNAME\ASPNET login is not mapped to any user in the
database (the below query did not return a row):
(select * from sysusers where sid = suser_sid('PCNAME\ASPNET'))
I've done the mapping:
CREATE USER [PCNAME\ASPNET] (DROP USER [PCNAME\ASPNET] to reset to
initial state)
I've verified that the user had permission to connect to the database:
select * from sys.database_permissions where grantee_principal_id =
user_id('user_name')
I've tried changing localhost to 192.168.x.x receiving the following
exception even if I enable mixed mode:
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.
What can I do???
Thanks,
Luigi.
setting:
<add name="SqlServerTrustedConn"
providerName="System.Data.SqlClient"
connectionString="Data Source=localhost;Initial
Catalog=GTSDB;Integrated Security=SSPI;" />
All worked great with my windows application.
Now I've copied the DAL of the windows application into a Web Service
project and when I open a connection I get the following exception:
Cannot open database "GTSDB" requested by the login. The login failed.
Login failed for user 'PCNAME\ASPNET'.
Since remote connections are disabled by default I've used the Surface Area
Configuration tool to enable them.
Then I've created a SQL login for the ASPNET account:
CREATE LOGIN [PCNAME\ASPNET] FROM WINDOWS
Since it didn't work I deleted the SQL login for the ASPNET account:
DROP LOGIN [PCNAME\ASPNET]
I've determined that PCNAME\WINDOWSUSER is the database owner:
select suser_sname(owner_sid) from sys.databases where name = 'GTSDB'
I've verified that 'sa' is the database owner according to the information
stored in the database itself:
select suser_sname(sid) from sysusers where uid = user_id('dbo')
I've found that the PCNAME\ASPNET login is not mapped to any user in the
database (the below query did not return a row):
(select * from sysusers where sid = suser_sid('PCNAME\ASPNET'))
I've done the mapping:
CREATE USER [PCNAME\ASPNET] (DROP USER [PCNAME\ASPNET] to reset to
initial state)
I've verified that the user had permission to connect to the database:
select * from sys.database_permissions where grantee_principal_id =
user_id('user_name')
I've tried changing localhost to 192.168.x.x receiving the following
exception even if I enable mixed mode:
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.
What can I do???
Thanks,
Luigi.