Click here to Skip to main content
15,860,972 members
Home / Discussions / C#
   

C#

 
AnswerRe: Conversion --- need explanation Pin
Rob Philpott28-May-09 2:16
Rob Philpott28-May-09 2:16 
GeneralRe: Conversion --- need explanation Pin
u060509428-May-09 5:54
u060509428-May-09 5:54 
GeneralRe: Conversion --- need explanation Pin
Rob Philpott28-May-09 6:10
Rob Philpott28-May-09 6:10 
GeneralRe: Conversion --- need explanation Pin
OriginalGriff28-May-09 6:19
mveOriginalGriff28-May-09 6:19 
GeneralRe: Conversion --- need explanation Pin
Rob Philpott28-May-09 6:22
Rob Philpott28-May-09 6:22 
GeneralRe: Conversion --- need explanation Pin
u060509430-May-09 2:51
u060509430-May-09 2:51 
GeneralRe: Conversion --- need explanation Pin
OriginalGriff28-May-09 6:14
mveOriginalGriff28-May-09 6:14 
AnswerRe: Conversion --- need explanation Pin
PIEBALDconsult28-May-09 3:26
mvePIEBALDconsult28-May-09 3:26 
Was this an interview question?


There's really nothing to explain.

Let's say you used ExecuteScalar to return an integer value from a database. The compiler doesn't know that the value is an int, all it knows is that the value's type derives from object. But you, the programmer, know it's an int (and not null) so you tell the compiler:

int x = (int) cmd.ExecuteScalar() ;

This type of cast is not a conversion, it's merely a note to the compiler that assigning the value to a variable of type int is safe.
Questionexecuting code in a textbox on runtime Pin
WinSolution28-May-09 1:35
WinSolution28-May-09 1:35 
QuestionRe: executing code in a textbox on runtime Pin
Rajesh R Subramanian28-May-09 1:50
professionalRajesh R Subramanian28-May-09 1:50 
AnswerRe: executing code in a textbox on runtime Pin
WinSolution28-May-09 2:12
WinSolution28-May-09 2:12 
GeneralRe: executing code in a textbox on runtime Pin
molesworth28-May-09 2:39
molesworth28-May-09 2:39 
GeneralRe: executing code in a textbox on runtime Pin
WinSolution28-May-09 3:39
WinSolution28-May-09 3:39 
GeneralRe: executing code in a textbox on runtime Pin
Searril28-May-09 5:21
Searril28-May-09 5:21 
AnswerRe: executing code in a textbox on runtime Pin
Giorgi Dalakishvili28-May-09 2:41
mentorGiorgi Dalakishvili28-May-09 2:41 
QuestionRe: executing code in a textbox on runtime Pin
harold aptroot28-May-09 3:26
harold aptroot28-May-09 3:26 
AnswerRe: executing code in a textbox on runtime Pin
WinSolution28-May-09 3:46
WinSolution28-May-09 3:46 
GeneralRe: executing code in a textbox on runtime Pin
harold aptroot28-May-09 3:54
harold aptroot28-May-09 3:54 
GeneralRe: executing code in a textbox on runtime Pin
molesworth28-May-09 4:49
molesworth28-May-09 4:49 
GeneralRe: executing code in a textbox on runtime Pin
WinSolution29-May-09 3:48
WinSolution29-May-09 3:48 
QuestionC++ dll in C# Pin
vijaywithu28-May-09 1:27
vijaywithu28-May-09 1:27 
QuestionHow to run powerpoint presentation (ppsm) file using C# in Web Based Application Pin
Anil Dwivedi28-May-09 0:21
Anil Dwivedi28-May-09 0:21 
AnswerRe: How to run powerpoint presentation (ppsm) file using C# in Web Based Application Pin
Tom Deketelaere28-May-09 0:31
professionalTom Deketelaere28-May-09 0:31 
GeneralRe: How to run powerpoint presentation (ppsm) file using C# in Web Based Application Pin
Anil Dwivedi28-May-09 2:06
Anil Dwivedi28-May-09 2:06 
QuestionWebBrowser Selected [modified] Pin
jammmie99928-May-09 0:18
professionaljammmie99928-May-09 0:18 

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.