简体   繁体   English

ASP.NET Web服务无法与IIS7中的数据库连接

[英]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.

相关问题 无法从IIS7中托管的ASP.Net Web应用使用Win Auth连接到数据库 - Unable to connect to database using Win Auth on from ASP.Net web app hosted in IIS7 将我的asp.net MVC Web应用程序部署到IIS7后,无法将其连接到SQL Server - Unable to connect my asp.net mvc web application to the sql server after deploying it to IIS7 在IIS7中运行C#ASP.net Soap Web服务 - Running C# ASP.net Soap Web Service in IIS7 asp.net Web应用程序中的ADO是否总是使用IIS服务帐户连接到SQL Server? - Does ADO in an asp.net web app always use the IIS service account to connect to SQL Server? 使用 IIS7 在 Web 服务器上部署 ASP.NET Webhooks - Deploying ASP.NET Webhooks on web server with IIS7 IIS7上带有web.config(?)的ASP.net Web开发问题 - ASP.net webdevelopment problem with web.config(?) on IIS7 在IIS7中集成2个ASP.NET Web应用程序 - Integrate 2 ASP.NET web applications within IIS7 IIS7上的ASP.NET Web API-找不到404 - ASP.NET Web API on IIS7 - Not Found 404 ASP.NET - 使用WCF Web服务绑定w / AD组的IIS7部署错误500 24 50 - ASP.NET - IIS7 Deployment Error 500 24 50 using WCF Web Service Binding w/ AD Groups ASP.NET的IIS7身份验证配置 - IIS7 authentication configuration for ASP.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM