![](/img/trans.png)
[英]How to list all 2013 workflows in SharePoint using powershell/c#
[英]How to retrieve all Sharepoint 2013 FBA user of a membership using console application [C#]?
我想創建一個控制台代理來檢索我已設置的所有SharePoint 2013 FBA用戶。 使用下面的代碼:
MembershipUserCollection uColl = System.Web.Security.Membership.GetAllUsers();
foreach (MembershipUser u in uColl)
{
Console.WriteLine(u.UserName);
}
控制台返回錯誤:
未處理的異常:System.Web.HttpException:無法連接到SQL Server數據庫。
我認為問題是執行代碼之前我沒有將連接字符串設置為SQL嗎? 那么如何建立連接? 抱歉,我是新來的。
您應該在Web應用程序的web.config中,控制台應用程序的app.config中具有連接字符串和成員資格提供程序。 這樣,您的應用程序將找到正確的參數來建立數據庫連接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.