Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
GeneralRe: Have you worked directly with 'ApplicationContext in WinForms ? Pin
Sascha Lefèvre7-Feb-16 18:56
professionalSascha Lefèvre7-Feb-16 18:56 
GeneralRe: Have you worked directly with 'ApplicationContext in WinForms ? Pin
BillWoodruff7-Feb-16 19:08
professionalBillWoodruff7-Feb-16 19:08 
GeneralRe: Have you worked directly with 'ApplicationContext in WinForms ? Pin
Sascha Lefèvre7-Feb-16 19:49
professionalSascha Lefèvre7-Feb-16 19:49 
QuestionOLEDB excel update is not working Pin
kvchennai7-Feb-16 17:11
kvchennai7-Feb-16 17:11 
General[REPOST] Pin
Sascha Lefèvre7-Feb-16 17:41
professionalSascha Lefèvre7-Feb-16 17:41 
GeneralRe: [REPOST] Pin
kvchennai7-Feb-16 18:03
kvchennai7-Feb-16 18:03 
Question(c#) if (label1.Text < label2.Text); ??? Pin
Member 104109727-Feb-16 5:47
Member 104109727-Feb-16 5:47 
AnswerRe: (c#) if (label1.Text < label2.Text); ??? Pin
OriginalGriff7-Feb-16 6:15
mveOriginalGriff7-Feb-16 6:15 
If you are trying to compare numeric values, then parse the strings into an appropriate number format first:
C#
int l1, l2;
if (!(int.TryParse(label1.Text, out l1) && int.TryParse(label2.Text, out l2)))
   {
   // Report or log a problem...
   return;
   }
if (l1 < l2)
   {
   ...
   }
If you don't, then string comparisons get a bit weird-seeming, because they base the entire comparison on the first different character pair then encounter in the two strings.
So the sort order isn't what you expect:
"1", "2", "3", ... "9", "10", "11", ...
Instead it orders them as
C#
"1", "10", "11", "12", ... "2", "20", "21", ...

Otherwise, just use the String.Compare Method (String, String, StringComparison) (System)[^] to return an integer indicating the result: 0 for "same", -1 for "first is less than second", 1 for "first is greater than second".
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: (c#) if (label1.Text < label2.Text); ??? Pin
Member 104109727-Feb-16 7:08
Member 104109727-Feb-16 7:08 
AnswerRe: (c#) if (label1.Text < label2.Text); ??? Pin
Richard MacCutchan7-Feb-16 6:20
mveRichard MacCutchan7-Feb-16 6:20 
Questiontableadapter updating! Pin
Isawyouoo6-Feb-16 14:42
Isawyouoo6-Feb-16 14:42 
AnswerRe: tableadapter updating! Pin
Dave Kreskowiak6-Feb-16 16:40
mveDave Kreskowiak6-Feb-16 16:40 
GeneralRe: tableadapter updating! Pin
Isawyouoo8-Feb-16 11:33
Isawyouoo8-Feb-16 11:33 
GeneralRe: tableadapter updating! Pin
Dave Kreskowiak8-Feb-16 16:41
mveDave Kreskowiak8-Feb-16 16:41 
Questionhow can i get this to work in c# Pin
elfenliedtopfan56-Feb-16 13:52
elfenliedtopfan56-Feb-16 13:52 
AnswerRe: how can i get this to work in c# Pin
Dave Kreskowiak6-Feb-16 16:39
mveDave Kreskowiak6-Feb-16 16:39 
AnswerRe: how can i get this to work in c# Pin
BillWoodruff7-Feb-16 2:50
professionalBillWoodruff7-Feb-16 2:50 
GeneralRe: how can i get this to work in c# Pin
Member 117127539-Feb-16 5:36
Member 117127539-Feb-16 5:36 
AnswerRe: how can i get this to work in c# Pin
Gerry Schmitz8-Feb-16 6:16
mveGerry Schmitz8-Feb-16 6:16 
QuestionHow To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev5-Feb-16 10:04
Tej_dev5-Feb-16 10:04 
AnswerRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak5-Feb-16 11:39
mveDave Kreskowiak5-Feb-16 11:39 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 5:10
Tej_dev8-Feb-16 5:10 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak8-Feb-16 8:50
mveDave Kreskowiak8-Feb-16 8:50 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 10:16
Tej_dev8-Feb-16 10:16 
QuestionDoes this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 0:15
Member 120616005-Feb-16 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.