Thanks for the additional information.
I found what causes the looping after Thread.Sleep and I'm embarrased to say.
The routine is acutally wrapped in a while loop but it wasn't obvious when I first looked over the code. It is a code sample for an activeX that I bought to build an opc server. Since I'm not real familiar with threading I first thought it had something to do with that.
Thanks for everyone's...
User Profile
Collapse
-
Thanks tlhintoq,
That was my main concern was whether something in the thread itself would cause it to repeat. I'll go back and look again through the rest of the code.
Also, thanks for the tip about using tags. I'll use them in future posts.
Thanks!Leave a comment:
-
Newbie threading question
hello,
I have a c# windows service that is working fine but I don't fully understand how the threading works. A new MTAThread is created and started. The method it is assigned to runs a couple of queries and at the end it calls Thread.Sleep (10000). At the end of this wait period the process repeats.
But, I don't understand what makes it go back to the beginning of the method and start over. There isn't any reset or...Last edited by tlhintoq; Jan 27 '10, 11:36 PM. Reason: [CODE] ...Your code goes between code tags [/CODE] -
cloud255....tha nks!
After all the replies I am much more familiar with using IComparer. Thanks to everyone for your input.Leave a comment:
-
Thanks to both of you for your replies.
tlhintoq, you really explained things well and you're right, I didn't know what was going on behind the scenes. Makes a lot more sense now. How did you know that it takes element 0 & 1 then 1 & 2, etc. ? I can't seem to find information on it....Leave a comment:
-
Confusion over how IComparer works
This is probably a newbie question but I'm really confused on how the IComparer works and I've looked for information online and offline. The code works, I just don't understand how.
I'm sorting an array that has only one element but the comparer has two arguments:
I've stepped through the code and I can see that both object a and...Code:public int Compare(object a, object b) { yada yada }Last edited by tlhintoq; Aug 31 '09, 08:47 PM. Reason: [CODE] ... your code here ... [/CODE] tags added -
Delerna, that's pretty cool. I had to modify your example but it works great!
[code=sql]
Select Distinct b.Field1
FROM
(select Field1 from TheTable GROUP BY TheTable.Field1 having count(Field1)>1 ) a
join TheTable b on a.Field1=b.Fiel d1
where b.Field2=6
[/code]
Many thanks to you and CK for your assistance! Thank you....Leave a comment:
-
I've tried that but it leaves out records. It only returns rows where Field1 AND Field2 occur more than once.
Here is the table with data.
ETF_AAA_Steve 14
ETF_AAA_Steve 30
ETF_AAA_Steve 6
ETF_Bethel_Fuel 2 6
ETF_Citrus_Comp _Sales 6
ETF_Citrus_Comp _Sales 6
OPL_Stevie 14
OPL_Stevie 30
OPL_Stevie 6
PinonPltIn_Gen_ Stat_DI1 30
PinonPltIn_Gen_ Stat_DI1 6...Leave a comment:
-
Group By and Having are driving me crazy!
Hello,
I'm trying to get a Select query in a stored proc to give the correct results but all I've done so far is pull hair out. Maybe one of you gurus out there can help me!
I have a table with information like this (sorry, couldn't make this look right):
Field1......... .............. Field2
ABC............ .............6
XYZ123......... ............6
XYZ123......... ............14...
No activity results to display
Show More
Leave a comment: