关于在IIS中托管WCF服务... [英] About Hosting WCF Service in IIS...
问题描述
有人可以帮助我吗?...我有WCF服务和Silverlight作为客户端.我必须在IIS中托管WCF服务,因此我已将clientaccesspolicy.xml和crossdomainpolicy.xml添加到我的Service应用程序中.
在我的本地系统中(在IIS上托管之前),客户端和服务均正常运行,
当我通过在WcfService上创建虚拟目录将其托管在IIS上时,出现了这样的错误消息:"无法打开登录名请求的数据库"MyFile".登录失败.
用户"SARATHM \ ASPNET"的登录失败."
我已将我的sql连接指定为
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?
推荐答案
您的应用程序正在帐户"SARATHM \ ASPNET"上运行,并且您正在使用Windows访问数据库验证.要访问数据库,应为用户创建一个登录名,然后只能执行任何与数据库相关的操作.
1-在数据库中为用户"SARATHM \ ASPNET"创建一个登录名.
2-将此用户添加到某些数据库角色或直接向用户提供执行db操作的权限.
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.
请查看
Have a look at this tutorial and make sure you have not missed out any steps.
这篇关于关于在IIS中托管WCF服务...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!