Click here to Skip to main content
15,895,370 members
Home / Discussions / C#
   

C#

 
AnswerRe: Mp3 Player Pin
DaveyM6930-Apr-09 2:20
professionalDaveyM6930-Apr-09 2:20 
AnswerRe: Mp3 Player Pin
Alaa' Al Atrash30-Apr-09 2:35
Alaa' Al Atrash30-Apr-09 2:35 
QuestionUnboxing an unknown type Pin
mtherien30-Apr-09 1:17
mtherien30-Apr-09 1:17 
AnswerRe: Unboxing an unknown type Pin
musefan30-Apr-09 1:34
musefan30-Apr-09 1:34 
GeneralRe: Unboxing an unknown type Pin
DaveyM6930-Apr-09 1:42
professionalDaveyM6930-Apr-09 1:42 
GeneralRe: Unboxing an unknown type Pin
musefan30-Apr-09 2:51
musefan30-Apr-09 2:51 
AnswerRe: Unboxing an unknown type Pin
DaveyM6930-Apr-09 1:41
professionalDaveyM6930-Apr-09 1:41 
GeneralRe: Unboxing an unknown type Pin
mtherien30-Apr-09 3:02
mtherien30-Apr-09 3:02 
I have thought of this, but the real world application (which I cannot post code from) doesn't allow this. (it doesn't have a "GetMyCar" function) This code sample was an attempt to demonstrate my real problem.

Basically, I have a datareader that stores all of it's values into an object array. One of these values are of type "int". I have generic code that takes the int object and loads it into a specific type. Casting it works on the standard .Net types but does not work on custom classes, like "MyCar" in the example.

object o= value;        // value is of type int, but this function does not know it
MyCar car = (MyCar)o;   // Fails


I guess I could right similar code here, like MyCar.CanConvertFrom() (using IConvertible) and then cast the value to int then do the explicit conversion. I was hoping I could do this in the MyCar class instead.
AnswerRe: Unboxing an unknown type Pin
Alan N30-Apr-09 1:59
Alan N30-Apr-09 1:59 
AnswerRe: Unboxing an unknown type Pin
Gideon Engelberth30-Apr-09 2:47
Gideon Engelberth30-Apr-09 2:47 
GeneralRe: Unboxing an unknown type Pin
mtherien30-Apr-09 3:13
mtherien30-Apr-09 3:13 
AnswerRe: Unboxing an unknown type Pin
mtherien30-Apr-09 3:49
mtherien30-Apr-09 3:49 
GeneralRe: Unboxing an unknown type Pin
S. Senthil Kumar30-Apr-09 9:47
S. Senthil Kumar30-Apr-09 9:47 
QuestionHow to write service in C# ? Pin
Yanshof30-Apr-09 0:41
Yanshof30-Apr-09 0:41 
AnswerRe: How to write service in C# ? Pin
stancrm30-Apr-09 0:53
stancrm30-Apr-09 0:53 
AnswerRe: How to write service in C# ? Pin
Alaa' Al Atrash30-Apr-09 2:18
Alaa' Al Atrash30-Apr-09 2:18 
QuestionProblrm with setup project. Pin
Narendra Reddy Vajrala30-Apr-09 0:30
Narendra Reddy Vajrala30-Apr-09 0:30 
AnswerRe: Problrm with setup project. [CROSS-POST Please Ignore!!!!!] Pin
Henry Minute30-Apr-09 0:53
Henry Minute30-Apr-09 0:53 
GeneralRe: Problrm with setup project. [CROSS-POST Please Ignore!!!!!] Pin
Narendra Reddy Vajrala30-Apr-09 0:59
Narendra Reddy Vajrala30-Apr-09 0:59 
QuestionAdding a text file to a c# project Pin
doubleteam30-Apr-09 0:21
doubleteam30-Apr-09 0:21 
AnswerRe: Adding a text file to a c# project Pin
Mycroft Holmes30-Apr-09 0:31
professionalMycroft Holmes30-Apr-09 0:31 
AnswerRe: Adding a text file to a c# project Pin
ATCsharp30-Apr-09 2:40
ATCsharp30-Apr-09 2:40 
Questionan exaple of converting string to code Pin
rachelicohen30-Apr-09 0:09
rachelicohen30-Apr-09 0:09 
AnswerRe: an exaple of converting string to code Pin
saanj30-Apr-09 0:14
saanj30-Apr-09 0:14 
AnswerRe: an exaple of converting string to code Pin
Mycroft Holmes30-Apr-09 0:27
professionalMycroft Holmes30-Apr-09 0:27 

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.