U SQL is using the windows integration security , but your web service is
running under the ASPNEt account, which may not have the access permission to
the DB by default.
In order to solve the problem, you can either:
1. Use mixed security mode in sql server, create a new sql db account, use
it in your connection string
2. Use Impersonation, to impersonate to a windows account which have the
privilage to access the sql.
3. Give the SQL access permission to ASPNET account or NEtworkService
account if you are running under win2k3. (not recommened)
Please note , when u use impersonation, dont "hard code" <impersonation> in
the web.config and make the web service alwasys run under that account.
instead. write some code, just temporaly enable the impersonation when you
doing the DB connection.
--
Can You?You Can.
"Khamal" wrote:
Hello....
My web service cannot connect to My MsSql DB.
error message...
----------------------
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll
Additional information: Server was unable to process request. --> Login
failed for user 'KHAMAL\ASPNET'.
Connection code
--------------
sqlConnection1.ConnectionString = "data source=Khamal;initial
catalog=pofil;integrated security=SSPI;persist security
info=False;workstation id=KHAMAL;packet size=4096"; //(oneline)
:: KHAMAL ::