473,464 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Unable to connect to MSSQL...return error

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 ::
Nov 23 '05 #1
4 4787
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 ::

Nov 23 '05 #2
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 ::

Nov 23 '05 #3
Hi Khamal,
Instead of changing the database to mixed mode, you can remove the
anonymous check in webservice. That would solve the problem.

Thanks,
Ragu.
"BillyLiu007" wrote:
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 ::

Nov 23 '05 #4
Hi Khamal,
Instead of changing the database to mixed mode, you can remove the
anonymous check in webservice. That would solve the problem.

Thanks,
Ragu.
"BillyLiu007" wrote:
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 ::

Nov 23 '05 #5

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

Similar topics

1
by: EricP | last post by:
Hello, First, sorry for my bad English. Here is my problem: BoxA: XPpro + Apache + php (using php_mssql.php)+ ADOdb + MS SQL Server + My_Prog (using local MS SQL PUBS database) BoxB: NT4...
2
by: Anilkumar | last post by:
H friends I have a strange problem. i am trying to connect to my sqlserver from client machine to server machine But i am not able to connect to the server from the client machine. The strange...
0
by: vicky | last post by:
Hello Experts, Trying to run sample Postgrel's ECPG(Embedded SQL)programs on RHL 9.0. Im unable to connect to PostgreSQL database (sirishadb) when I run the program .... # su postgres...
1
by: Antonello Calabrò | last post by:
Hi all, I created a webservice that execute a sql query on demand. If I try to execute the query from the WebForm, all is ok. If I try to execute the query from a normal Windows Application,...
0
by: Khamal | last post by:
Hello.... My web service cannot connect to My MsSql DB. error message... ---------------------- An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in...
4
by: aryan2cool | last post by:
hii all i am using php 5 and a warning has occured in my application " Warning: mssql_connect() : message: Login failed for user 'PAYDATA'. (severity 14) in C:\WINNT\Temp\tmpqjqokj.php on...
1
by: Markw | last post by:
Hi folks I think I've got a variable problem but not 100% sure. Background: I took the CMS example from chapter 6 in "Build your Own Database Driven Website Using PHP&MySQL" and have attempted to...
0
by: dreamer247 | last post by:
hii all i am working with mssql 2000 and after restoring a databas from device the warning is .. Warning: mssql_connect() : message: Cannot open user default database. Using master database...
2
by: yashiro | last post by:
Hello , i am moving my server (php,apache (wamp 2c)) to a new machine. while executing my php file ,i get the warning : Warning : mssql_connect() : unable to connect to server ..... i dont...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.