[英]ASP.NET web service does not connect with database in IIS7
When I try to publish my asp.net web service application on IIS7, my application works perfect when debugging with Visual Studio. 当我尝试在IIS7上发布asp.net Web服务应用程序时,在使用Visual Studio进行调试时,我的应用程序可以完美运行。 But, when I try to access my webservice from IIS by typing on browser:
http://localhost:port/Service1.asmx
and click on the method and then click "Invoke" it gives me this error: 但是,当我尝试通过在浏览器上键入以下内容来从IIS访问IIS的Web服务时:
http://localhost:port/Service1.asmx
并单击该方法,然后单击“调用”,这会给我这个错误:
System.Data.SqlClient.SqlException: The SELECT permission was denied on the object 'Marimi', database 'eMagazin', schema 'dbo'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at WebService.Service1.GetMarime() in C:\Users\Eduard\Desktop\MaG_beta01\MaG\WebService\Service1.asmx.cs:line 741
My Connection to database in web.Config is : 我在web.Config中与数据库的连接是:
<connectionStrings>
<add name="connection" connectionString="Data Source=EDUARD-PC\EDD;Initial Catalog=eMag; Integrated Security=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
and I use as Application Pool the ASP.NET v4.0 Classic 我将ASP.NET v4.0 Classic用作应用程序池
I've searched for the solutions on google but I haven't found anything helpful.... Thank you all in advance... 我已经在Google上搜索了解决方案,但没有发现任何帮助。...预先谢谢大家...
“应用程序池标识”对您的数据库没有权限:要么不使用集成安全性,要么为拥有数据库权限的appool创建专用用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.