Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, Can any one help me.... I have a WCF Service and Silverlight as client. I have to host the WCF Service in IIS, So i have added clientaccesspolicy.xml and crossdomainpolicy.xml to my Service application.

In my local system(Before hosting on IIS) both the Client and Service were working fine,
When i hosted it on IIS by creating Virtual Directory to WcfService i am getting the error message like this "Cannot open database "MyFile" requested by the login. The login failed.
Login failed for user 'SARATHM\ASPNET'."


I have given my sql connection as

"new SqlConnection("Data Source=System_name\\sqlexpress; Integrated Security=SSPI;Initial Catalog=MyFile; User Instance=true;");"


Can any one suggest me wht I have to do?
Posted
Updated 26-Mar-10 20:19pm
v2

Your application is running on account 'SARATHM\ASPNET', and you are accessing the database using windows authentication. To access the database a login should be created for the user then only any db related operations can be performed.

1- Create A login in the Database for the user 'SARATHM\ASPNET'.

2- Add this user to some database role or directly provide the permissions to user to perform the db operations.
 
Share this answer
 
v2
Have a look at this tutorial and make sure you have not missed out any steps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900