Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Thread Names via Dataset Count

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
Hi,

I'm pulling a row count from a dataset. The number of rows vary with each client.
Using the row count I'm creating a Dictionary of Thread Names

Code:
        Dim threadsDIC As New Dictionary(Of String, Thread)()
        Dim variableName = "Thread"

For i As Integer = 1 To dscustprofile.Tables(0).Rows.Count
 threadsDIC(variableName & i.ToString()) = New Thread(AddressOf [b]DoOdfl[/b])

Next


I also want to dynamically change the AddressOf (ref above "Addressof DoOdfl) which is actually the name of the function the thread will use.
I want to populate the AddressOf from a field in the dataset.

Haven't had much success. Any ideas how I can dynamically change the AddressOf. Strings wont work. has to be a name of a method/prod etc.

Thanks
-dan
 
Solved it by creating separate classes that I can import and reference

Imports rate_abfs.get_rates

blah blah blah

threadsDIC(variableName & i.ToString()) = New Thread(AddressOf rate_abfs.get_rates)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top