C# .NET - database login error - Asked By renchu koshy on 28-Feb-12 11:15 AM

I have a webservice which has a get details method to load a dropdown list.Its running fine but when i call it from a website using web reference it gives error "system.web.services.protocols.soapexception:server was unable to process request.--->System.Exception:Fetch Error:cannot open user default database.Login failed." Could anyone help me?
Web Star replied to renchu koshy on 28-Feb-12 11:55 AM
Check the connection string for that may be something wrong that's why the connection are not established and you are getting fail error. Only the need to valid connection string with valid credential.
D Company replied to renchu koshy on 28-Feb-12 01:03 PM
Hello friend,

Some times back, i have faced this issue, the scenario was like this. i tried to bind a grid from sql DB, it was working fine with windows uthentication but when i put my web on IIS and tried to access with the webservice, faced same error , i tried  to create a seprate user for that particular DB , given full access right ,and able to do.

So the conclusion is check the Db access rights to that method with the specified credential , and chenge it accordingly , and also dont forget to click on set permission for that site from IIS and set the necessary settings

Hope its clear
Regards
D
kalpana aparnathi replied to renchu koshy on 28-Feb-12 01:03 PM

Hi

try this link...http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/a92a298a-d272-458b-a8ac-c6dabf82f453/

Check whether the default database exists in the server. If not then change the default database to the one that exists.

http://support.microsoft.com/kb/307864

hope it helps!!!!!!!!!!!!!!!!!

thanks,

Somesh Yadav replied to renchu koshy on 29-Feb-12 05:03 AM

Hi,

Add the following key just above httphandler section in web.config

<identity impersonate = "true" UserName = "Domainname\Username" Password = "Password" />

By username i mean ur windows username and password u use to login

in the identity key

instead of machinename\username add only username

for eg

ur Login = MAK

Pass = abc

then key will be

<identity impersonate ="true" userName ="MAK" password =" abc/>

If it  till gives the error let me know what it is