I would like to create a console agent to retrieve all SharePoint 2013 FBA user that I have setup. Using the code below:
MembershipUserCollection uColl = System.Web.Security.Membership.GetAllUsers();
foreach (MembershipUser u in uColl)
{
Console.WriteLine(u.UserName);
}
The console returns error:
Unhandled Exception: System.Web.HttpException: Unable to connect to SQL server database.
I think the problem is I didn't not setup my Connection String to SQL before execute the code? How to setup the connection then? Sorry I am new to this.