简体   繁体   English

Sharepoint Webpart

[英]Sharepoint Webpart

I have created a webpart which works fantastic on my Virtual Machine where I have developed it. 我创建了一个Webpart,在我开发它的虚拟机上可以很好地工作。

But When I try to run the same webpart on my physical Machine, I cannot open the SQL Connection as the SQL Server is Seperate box on the network. 但是,当我尝试在物理计算机上运行相同的Web部件时,由于网络上的“ SQL Server为单独”框,因此无法打开SQL连接。

My Physical, Virtual and SQL Box are on the Same network but for some reason, It doesn't work on my Physical Machine, 我的物理机,虚拟机和SQL Box位于同一网络上,但是由于某些原因,它在我的物理机上不起作用,

It Come up with the following Message: Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON' 它带有以下消息:用户'NT AUTHORITY \\ ANONYMOUS LOGON'登录失败

What causes this Issue? 是什么原因导致此问题?

You are using Intgrated Security, which means the current User is used for authentication against the database service. 您正在使用集成安全性,这意味着当前用户用于针对数据库服务进行身份验证。 On the production server the webpart code is executed, using the anonymous user. 在生产服务器上,使用匿名用户执行Webpart代码。 And (of course) this user has no right to access any ressources other the web server files. 并且(当然)该用户无权访问Web服务器文件以外的任何资源。

To avoid this behaviour use a dedicated account using SQL-Server security. 为避免此行为,请使用使用SQL Server安全性的专用帐户。 See this example Connection string: 请参见以下示例连接字符串:

connectionString="Data Source=SERVERHOSTNAME;Initial Catalog=YOURDATABASE;Persist Security Info=True;User ID=YOURUSER;Password=YOURPASSWORD";

Be sure to get a valid logon from your production database administrator for your database with appropriate rights (such as db_reader). 确保从生产数据库管理员那里获得具有适当权限(例如db_reader)的数据库的有效登录。

您指定了User IdPassword ,然后将Trusted_Connection设置为True ,因此我想使用了集成身份验证-删除Trusted_Connection=True部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM