Click here to Skip to main content
15,892,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: (4/4)%2 = 1? wtf? Pin
leppie4-Mar-08 5:59
leppie4-Mar-08 5:59 
GeneralRe: (4/4)%2 = 1? wtf? Pin
jchalfant4-Mar-08 6:41
jchalfant4-Mar-08 6:41 
GeneralRe: (4/4)%2 = 1? wtf? Pin
leppie4-Mar-08 7:18
leppie4-Mar-08 7:18 
GeneralRe: (4/4)%2 = 1? wtf? Pin
jchalfant4-Mar-08 7:38
jchalfant4-Mar-08 7:38 
AnswerRe: (4/4)%2 = 1? wtf? Pin
Guffa4-Mar-08 8:13
Guffa4-Mar-08 8:13 
GeneralRe: (4/4)%2 = 1? wtf? Pin
jchalfant4-Mar-08 8:26
jchalfant4-Mar-08 8:26 
AnswerRe: (4/4)%2 = 1? wtf? Pin
Luc Pattyn4-Mar-08 13:13
sitebuilderLuc Pattyn4-Mar-08 13:13 
GeneralRe: (4/4)%2 = 1? wtf? Pin
jchalfant4-Mar-08 13:29
jchalfant4-Mar-08 13:29 
I wish it were so simple. Datacolumn.Expression, any expression in an activex data object actually, doesn't support bitwise operators.

So, that's no big deal x/y%2 should work. Right? Nope.

ADO.net objects return a double to the engine before computing the modulus. So int/int%2 turns into double%2, which isn't supported. Convert won't work because it performs a Round instead of a cast.

In the end, what I wound up settling on was computing the boolean values as bit fields when I retrieve the data from the database.
GeneralRe: (4/4)%2 = 1? wtf? Pin
Luc Pattyn4-Mar-08 14:07
sitebuilderLuc Pattyn4-Mar-08 14:07 
Generalreading a binary file Pin
ES Kim4-Mar-08 4:21
ES Kim4-Mar-08 4:21 
AnswerRe: reading a binary file Pin
Eslam Afifi4-Mar-08 4:50
Eslam Afifi4-Mar-08 4:50 
GeneralAttempted to read and write protected memory… ActiveX on Vista Pin
anderslundsgard4-Mar-08 4:18
anderslundsgard4-Mar-08 4:18 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
leppie4-Mar-08 6:00
leppie4-Mar-08 6:00 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
Pete O'Hanlon4-Mar-08 10:08
mvePete O'Hanlon4-Mar-08 10:08 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
anderslundsgard4-Mar-08 19:59
anderslundsgard4-Mar-08 19:59 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
anderslundsgard4-Mar-08 20:10
anderslundsgard4-Mar-08 20:10 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
Pete O'Hanlon4-Mar-08 23:13
mvePete O'Hanlon4-Mar-08 23:13 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
anderslundsgard5-Mar-08 0:41
anderslundsgard5-Mar-08 0:41 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
mav.northwind5-Mar-08 3:21
mav.northwind5-Mar-08 3:21 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
anderslundsgard5-Mar-08 4:11
anderslundsgard5-Mar-08 4:11 
GeneralRe: Attempted to read and write protected memory… ActiveX on Vista Pin
Devil's Priest3-Jun-09 0:33
Devil's Priest3-Jun-09 0:33 
GeneralXML Element close tag appearing on new line Pin
Chazzysb4-Mar-08 4:12
Chazzysb4-Mar-08 4:12 
GeneralRe: XML Element close tag appearing on new line Pin
Pete O'Hanlon4-Mar-08 4:41
mvePete O'Hanlon4-Mar-08 4:41 
QuestionHelp in selecting attributes with XPath [modified] Pin
student_rhr4-Mar-08 4:02
student_rhr4-Mar-08 4:02 
GeneralRe: Help in selecting attributes with XPath Pin
Christian Graus4-Mar-08 9:22
protectorChristian Graus4-Mar-08 9:22 

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.