Click here to Skip to main content
15,924,452 members
Home / Discussions / C#
   

C#

 
QuestionHaving issues with Object comparison [modified] Pin
myNameIsRon20-Mar-07 20:59
myNameIsRon20-Mar-07 20:59 
AnswerRe: Having issues with Object comparison Pin
joon vh.20-Mar-07 22:09
joon vh.20-Mar-07 22:09 
GeneralRe: Having issues with Object comparison Pin
myNameIsRon21-Mar-07 5:05
myNameIsRon21-Mar-07 5:05 
GeneralRe: Having issues with Object comparison Pin
joon vh.21-Mar-07 5:23
joon vh.21-Mar-07 5:23 
GeneralRe: Having issues with Object comparison Pin
myNameIsRon21-Mar-07 5:40
myNameIsRon21-Mar-07 5:40 
GeneralRe: Having issues with Object comparison Pin
joon vh.21-Mar-07 5:46
joon vh.21-Mar-07 5:46 
GeneralRe: Having issues with Object comparison Pin
myNameIsRon21-Mar-07 16:50
myNameIsRon21-Mar-07 16:50 
GeneralRe: Having issues with Object comparison Pin
myNameIsRon21-Mar-07 18:55
myNameIsRon21-Mar-07 18:55 
OK, I see now...
I'm a fairly new programmer (with no formal training), so I'm not familiar with object comparison. The other methods (min, max) use IComparable, but they don't bother using it for the ColumnEqual method.

I've changed:
return (a==b); //value type standard comparison

to:
if (((IComparable)a).CompareTo(b) == 0)
return true;
else
return false;

works great now, on the different data types and my OleDbCommand string results.

Ron
AnswerRe: Having issues with Object comparison Pin
Pete O'Hanlon20-Mar-07 23:29
mvePete O'Hanlon20-Mar-07 23:29 
GeneralRe: Having issues with Object comparison Pin
myNameIsRon21-Mar-07 4:52
myNameIsRon21-Mar-07 4:52 
QuestionCalling a method without object or its class name.. Pin
nasambur20-Mar-07 20:40
nasambur20-Mar-07 20:40 
AnswerRe: Calling a method without object or its class name.. Pin
Martin#20-Mar-07 21:25
Martin#20-Mar-07 21:25 
GeneralRe: Calling a method without object or its class name.. Pin
joon vh.20-Mar-07 22:13
joon vh.20-Mar-07 22:13 
AnswerRe: Calling a method without object or its class name.. Pin
Russell Jones21-Mar-07 1:14
Russell Jones21-Mar-07 1:14 
QuestionSQL: getting and storing data Pin
Glen Harvy20-Mar-07 20:29
Glen Harvy20-Mar-07 20:29 
AnswerRe: SQL: getting and storing data Pin
KaineDunno20-Mar-07 21:57
KaineDunno20-Mar-07 21:57 
GeneralRe: SQL: getting and storing data Pin
Keshav V. Kamat21-Mar-07 0:49
Keshav V. Kamat21-Mar-07 0:49 
GeneralRe: SQL: getting and storing data Pin
Glen Harvy21-Mar-07 1:32
Glen Harvy21-Mar-07 1:32 
QuestionQuestion about C++ and C# ... Pin
Yanshof20-Mar-07 20:23
Yanshof20-Mar-07 20:23 
AnswerRe: Question about C++ and C# ... Pin
WillemM20-Mar-07 22:04
WillemM20-Mar-07 22:04 
Questioncrystal report calling [modified] Pin
virendra patel20-Mar-07 20:11
virendra patel20-Mar-07 20:11 
AnswerRe: crystal report calling Pin
virendra patel20-Mar-07 20:15
virendra patel20-Mar-07 20:15 
Questionusing .Net dll in deployment custom actions Pin
William Ten Broek20-Mar-07 20:10
William Ten Broek20-Mar-07 20:10 
QuestionCan not read Environment variables on HttpRequest Pin
Ranjit1620-Mar-07 19:29
Ranjit1620-Mar-07 19:29 
QuestionCapture the computer screen and save as a bit map file in c# Pin
rangaSL20-Mar-07 19:28
rangaSL20-Mar-07 19:28 

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.