vb.net threding

Is it possible to pass variables in to a thread? What im trying to do is pass a client id into a routine that will process that clients data? Any one got any ideas or links , Thanks in advance
agent_xpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ralf KlattEmployee in Civil ServiceCommented:
Hi,

You may pass anything you want into a thread ... I'd suggest the following samples as a starting point: http://www.codeproject.com/vb/net/threadingvbnet.asp


Best regards,
Raisor
0
agent_xpAuthor Commented:
ok , thats fine , but i get errors


What I want to do is select the customer and then start the thread to process the customers data,
eg
for each of the customers in the data base, one customer at a time select the data process method and pass in the customer id as the parameter into the thread eg


For Each c As ds.customer In ds.customers

Select case (data process method)

 Case “process 1”
   Start process thread 1(customerid)
 Case “process 2”
   Start process thread 1(customerid)

...... 14 different data process methods

End select

next


I hope this helps , any ideas
0
Ralf KlattEmployee in Civil ServiceCommented:
Hi,

I'd suggest building "classes" -> better to say "class collections" ... meaning, to build class collections according to the running processes ... each process (tied to a customer) would have an own interface (two processes, fourteen processes ... or whatever number) ... it's just an idea ;-) ...


Best regards,
Raisor
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AlexFMCommented:
Thread function belongs to class and can work with any class variable. Set class member to desired value and start the thread.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
As AlexFM said...

If you need a different value for each thread, then enapsulate your thread in a Class and pass the value into that class so the Thread can access it.  Then you instantiate your Class for each value and start your threads...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agent_xpAuthor Commented:
thanks Idle_Mind sorry its late
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.