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

C#

 
GeneralRe: error in c# Pin
Nuri Ismail18-Aug-10 5:13
Nuri Ismail18-Aug-10 5:13 
AnswerRe: error in c# Pin
OriginalGriff18-Aug-10 5:12
mveOriginalGriff18-Aug-10 5:12 
Questionc# Pin
galatia-318-Aug-10 4:06
galatia-318-Aug-10 4:06 
AnswerRe: c# PinPopular
Bernhard Hiller18-Aug-10 4:14
Bernhard Hiller18-Aug-10 4:14 
AnswerRe: c# Pin
Ian Shlasko18-Aug-10 4:18
Ian Shlasko18-Aug-10 4:18 
AnswerRe: c# Pin
J4amieC18-Aug-10 4:50
J4amieC18-Aug-10 4:50 
AnswerRe: c# Pin
OriginalGriff18-Aug-10 5:16
mveOriginalGriff18-Aug-10 5:16 
AnswerHomework alert, bad subject line alert, laziness alert PinPopular
Luc Pattyn18-Aug-10 5:48
sitebuilderLuc Pattyn18-Aug-10 5:48 
AnswerNormally, I wouldn't answer homework Pin
Ennis Ray Lynch, Jr.18-Aug-10 6:31
Ennis Ray Lynch, Jr.18-Aug-10 6:31 
GeneralRe: Normally, I wouldn't answer homework Pin
Chris Trelawny-Ross19-Aug-10 6:13
Chris Trelawny-Ross19-Aug-10 6:13 
AnswerRe: c# Pin
Dan Mos18-Aug-10 7:30
Dan Mos18-Aug-10 7:30 
AnswerRe: c# Pin
Ravi Bhavnani18-Aug-10 10:28
professionalRavi Bhavnani18-Aug-10 10:28 
QuestionConnect to network equipment Pin
grmihel218-Aug-10 2:49
grmihel218-Aug-10 2:49 
AnswerMessage Closed Pin
18-Aug-10 3:19
stancrm18-Aug-10 3:19 
GeneralRe: Connect to network equipment Pin
grmihel218-Aug-10 3:30
grmihel218-Aug-10 3:30 
QuestionHow can I get the name of the object from Reflection ? Pin
Nadia Monalisa18-Aug-10 2:29
Nadia Monalisa18-Aug-10 2:29 
Hello,
I need to get the name of the Object using Reflection, but I am getting all information about how to get the name of the Type using Reflection rather than the Object. For example, I got the following code,

public class Demo
{
    public int ID { get; set; }
    public string Name { get; set; }
}


private void button1_Click(object sender, EventArgs e)
{
    Demo myDemo = new Demo {ID = 10, Name = "Kab"};
  
    var theType = myDemo.ID.GetType();
    MessageBox.Show(theType.Name);
}


When I click the button1, The message box shows "Int32", but I need to see "ID". Would you please tell me how I can achieve this goal!

Regards.
GeneralRe: How can I get the name of the object from Reflection ? Pin
harold aptroot18-Aug-10 2:50
harold aptroot18-Aug-10 2:50 
GeneralRe: How can I get the name of the object from Reflection ? Pin
Nadia Monalisa18-Aug-10 3:17
Nadia Monalisa18-Aug-10 3:17 
GeneralRe: How can I get the name of the object from Reflection ? Pin
harold aptroot18-Aug-10 3:26
harold aptroot18-Aug-10 3:26 
GeneralRe: How can I get the name of the object from Reflection ? Pin
Nadia Monalisa18-Aug-10 3:41
Nadia Monalisa18-Aug-10 3:41 
GeneralRe: How can I get the name of the object from Reflection ? Pin
harold aptroot18-Aug-10 3:53
harold aptroot18-Aug-10 3:53 
GeneralRe: How can I get the name of the object from Reflection ? Pin
Nadia Monalisa18-Aug-10 4:04
Nadia Monalisa18-Aug-10 4:04 
GeneralRe: How can I get the name of the object from Reflection ? Pin
Łukasz Nowakowski18-Aug-10 4:51
Łukasz Nowakowski18-Aug-10 4:51 
AnswerRe: How can I get the name of the object from Reflection ? Pin
PIEBALDconsult18-Aug-10 3:18
mvePIEBALDconsult18-Aug-10 3:18 
GeneralRe: How can I get the name of the object from Reflection ? Pin
Nadia Monalisa18-Aug-10 3:42
Nadia Monalisa18-Aug-10 3:42 

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.