Last post Apr 07, 2013 06:43 AM by jsiahaan
Apr 07, 2013 02:21 AM|Saeid1984|LINK
I have a web site in ASP.NET 4 that need Connect to SQL Server 2008 R2 with Parallelism,Also Use IIS 7 and Windows authentication.
I use Parallel.Foreach expression, When I use Foreach every thing is fine, but in Parallel.Foreach I get an error: Login failed for user: 'IIS APPPOOL\\MyAppPool'.
After some search I found need to change Process Model identity in Application pool From
ApplicationPoolIdentity to LocalSystem.
I check the User in My SP by Suser_Sname(): When I use foreach (mean without parallelism) all the registered user is MyLoginUser but with Parallel.foreach (And LocalSystem Identity) the first user registered is
MyLoginUser and the others is NT Authority System.
In final I try to use ApplicationPoolIdentity and MyLoginUser to use Parallelism to connect to SQL. Does any one have any suggestion?
I found that the first connection to db is the MyLoginUser then the ASP.NET try to connect more and let ApplicationPool do this, but the applicationpool can not login because have not permission and I also don't want to let it, the only user could connect
must be myloginuser.
So the question is:
How config IIS or ASP.NET to use myloginuser (the same of first user) to connect with all connections to db (also in Parallel connections)?
Apr 07, 2013 06:43 AM|jsiahaan|LINK
This free video tutorial may be can help. It's on this site.