Click here to Skip to main content
16,005,222 members
Home / Discussions / C#
   

C#

 
AnswerThe cleaner method Pin
Ennis Ray Lynch, Jr.14-Nov-07 9:26
Ennis Ray Lynch, Jr.14-Nov-07 9:26 
QuestionBit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 4:35
Jeffrey Walton14-Nov-07 4:35 
AnswerRe: Bit Testing and operator unchecked() Pin
Luc Pattyn14-Nov-07 5:08
sitebuilderLuc Pattyn14-Nov-07 5:08 
GeneralRe: Bit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 5:41
Jeffrey Walton14-Nov-07 5:41 
GeneralRe: Bit Testing and operator unchecked() Pin
Luc Pattyn14-Nov-07 5:52
sitebuilderLuc Pattyn14-Nov-07 5:52 
GeneralRe: Bit Testing and operator unchecked() Pin
Judah Gabriel Himango14-Nov-07 5:54
sponsorJudah Gabriel Himango14-Nov-07 5:54 
GeneralRe: Bit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 6:09
Jeffrey Walton14-Nov-07 6:09 
GeneralRe: Bit Testing and operator unchecked() Pin
Guffa14-Nov-07 9:24
Guffa14-Nov-07 9:24 
Jeffrey Walton wrote:
Changing:
Byte.Parse(Octets[0].ToString())
to
(Byte)Octets[0]
reults in Compiler Error:
Error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement


Then you obviously changed something more in that statement. If you only changed that, it would compile just fine.

Jeffrey Walton wrote:
changing from Parse() and ToString() to
(Int32)Octets[0] / 40
results in Runtime Error:
An unhandled exception of type 'System.InvalidCastException' occurred in OIDFetch.exe
Additional information: Specified cast is not valid.


When you are unboxing a boxed value, you have to use the exact data type of the boxed value. Once you have unboxed it to get the byte value, you can cast it to an int if you like.

Experience is the sum of all the mistakes you have done.

GeneralRe: Bit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 6:05
Jeffrey Walton14-Nov-07 6:05 
GeneralRe: Bit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 6:08
Jeffrey Walton14-Nov-07 6:08 
GeneralRe: Bit Testing and operator unchecked() Pin
Luc Pattyn14-Nov-07 6:39
sitebuilderLuc Pattyn14-Nov-07 6:39 
AnswerRe: Bit Testing and operator unchecked() Pin
Guffa14-Nov-07 9:15
Guffa14-Nov-07 9:15 
GeneralRe: Bit Testing and operator unchecked() Pin
Jeffrey Walton14-Nov-07 11:33
Jeffrey Walton14-Nov-07 11:33 
AnswerBit Testing And operator~ Pin
Jeffrey Walton14-Nov-07 11:49
Jeffrey Walton14-Nov-07 11:49 
QuestionDataSet Design to database Pin
cecildt14-Nov-07 4:26
cecildt14-Nov-07 4:26 
AnswerRe: DataSet Design to database Pin
Colin Angus Mackay14-Nov-07 4:30
Colin Angus Mackay14-Nov-07 4:30 
GeneralRe: DataSet Design to database Pin
cecildt14-Nov-07 4:43
cecildt14-Nov-07 4:43 
GeneralRe: DataSet Design to database Pin
Pete O'Hanlon14-Nov-07 4:57
mvePete O'Hanlon14-Nov-07 4:57 
GeneralRe: DataSet Design to database Pin
Colin Angus Mackay14-Nov-07 5:24
Colin Angus Mackay14-Nov-07 5:24 
AnswerRe: DataSet Design to database Pin
Brady Kelly14-Nov-07 5:19
Brady Kelly14-Nov-07 5:19 
QuestionAbout ReportViewer in c# Pin
Davood Riazi14-Nov-07 3:27
Davood Riazi14-Nov-07 3:27 
AnswerRe: About ReportViewer in c# Pin
Justin Perez14-Nov-07 3:58
Justin Perez14-Nov-07 3:58 
GeneralRe: About ReportViewer in c# Pin
Davood Riazi14-Nov-07 4:35
Davood Riazi14-Nov-07 4:35 
GeneralRe: About ReportViewer in c# Pin
Justin Perez14-Nov-07 4:51
Justin Perez14-Nov-07 4:51 
GeneralRe: About ReportViewer in c# Pin
Justin Perez14-Nov-07 4:51
Justin Perez14-Nov-07 4:51 

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.