hi all
i try to send data into Thread function - the data is : string[][] DataTimes
but i get eror!!!

this my function that Start the Thread:

Thread newThread = new Thread(Form1.PlayTheClock);

that the Thread Function:

public static void PlayTheClock(string[][] DataTimes)

the problem is : Error 1 The best overloaded method match for 'System.Threading.Thread.Thread(System.Threading.ParameterizedThreadStart)' has some invalid arguments


Recommended Answers

All 6 Replies

First question, you start thread with


Where is DataTimes defined?

If no parameters to pass:

//1. way:
 new Thread(new ThreadStart(MethodNoParams)).Start();//calling new method

//2. longer way (if you need a "t" variable maybe):
Thread t = new Thread(new ThreadStart(MethodNoParams)); //calling new method

If parameters to pass:

object obj ="some param";
Thread t1 = new Thread(new ParameterizedThreadStart(MethodWithParams)); //calling new method

MethodNoParams is a method that accepts no parameters, while MethodWithParams is a method which accpets parameter.
Just for your knowledge:

private void MethodNoParams()

        private void MethodWithParams(object args)

hi thanks
but i dont know how to convert (string[][] DataTimes) to (Object)
and (Object) to (string[][] DataTimes).

You literally just did it in that post. =p (Object)DataTimes (String[][])args

wooow thanks mann that wooorrkkk!!!

thx Ketsuekiame.
I wasnt around this morning...

I am glad it does.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.