TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ruben Vera
NA
3
0
Problem Looping controls using Parallel.foreach
Jun 8 2010 6:23 AM
Hello,
i'm trying to loop through all my controls using Parallel.Foreach but i'm having some problems... I thought I was going to have no problems cause the ControlCollection class implements IEnumerable...
This is what I do without Parallel:
foreach
(
Control
c
in
ascx.Controls)
{
if
(c
is
Dynamic.Controls.
UnoN
&& UnaNaAcumulados.IndexOf(c.ID+
","
)==-1)
{
UnaNaAcumulados += c.ID +
","
;
Control
caux = (
Control
)
this
.LoadControl(
"~/Datos/UaN_"
+ c.ID +
".ascx"
);
UaNNames(caux);
}
}
And I'm trying to do the same with parallel, something like this:
Parallel
.ForEach<
Control
>(ascx.Controls, c => {
if
(c
is
Dynamic.Controls.
UnoN
) {
UnaNaAcumulados += c.ID +
","
;
Control
caux = (
Control
)
this
.LoadControl(
"~/Datos/UaN_"
+ c.ID +
".ascx"
);
UaNNames(caux);
}
});
But it says that ControlCollection cannot be converted to OrderablePartitioner.
Any ideas?? I've been looking for some help but i'm stuck.
Thanks a lot in advance.
Reply
Answers (
1
)
FAST QUERY POINT MOVEMENT TECHNIQUES FOR LARGE CBIR SYSTEMS
Using NULL-COALESCE Operator in C#