Click here to Skip to main content
15,890,557 members
Home / Discussions / C#
   

C#

 
AnswerRe: filtering data for dataset that is bound to grid Pin
gauthee30-Mar-07 0:08
gauthee30-Mar-07 0:08 
GeneralRe: filtering data for dataset that is bound to grid Pin
JacquesDP30-Mar-07 0:13
JacquesDP30-Mar-07 0:13 
GeneralRe: filtering data for dataset that is bound to grid Pin
kalyan_241630-Mar-07 0:39
kalyan_241630-Mar-07 0:39 
GeneralRe: filtering data for dataset that is bound to grid Pin
JacquesDP30-Mar-07 1:20
JacquesDP30-Mar-07 1:20 
GeneralRe: filtering data for dataset that is bound to grid Pin
gauthee30-Mar-07 1:34
gauthee30-Mar-07 1:34 
QuestionSome data Decrypt to return error Length of the data to decrypt is invalid Pin
alpaslanaykovan29-Mar-07 23:57
alpaslanaykovan29-Mar-07 23:57 
AnswerRe: Some data Decrypt to return error Length of the data to decrypt is invalid Pin
Ennis Ray Lynch, Jr.30-Mar-07 4:04
Ennis Ray Lynch, Jr.30-Mar-07 4:04 
QuestionInheritance and reflection Pin
Russell Jones29-Mar-07 23:15
Russell Jones29-Mar-07 23:15 
I've got an abstract base class containing a guild field called _id.

I've derived some classes from my base class.

1 class has overridden the _id field and one hasn't.

My problem is that the object that doesn't override the _id field fails on the SetValue() call with Field == null so i get 'Object reference not set...'

public static void InjectID(Guid id,AbstractBase dataObject)<br />
{<br />
   //Type abstractBaseType = typeof(AbstractBase);<br />
   Type abstractBaseType = dataObject.GetType();<br />
   FieldInfo Field = abstractBaseType .GetField("_id");<br />
   Field.SetValue(dataObject, id);<br />
}<br />


The commented out line was my original code and the line below it was an attempted fix, but both behave in the same way.

Is there a way of getting to the fields defined in a base class?

Thanks

Russell
AnswerRe: Inheritance and reflection Pin
Stefan Troschuetz29-Mar-07 23:36
Stefan Troschuetz29-Mar-07 23:36 
GeneralRe: Inheritance and reflection Pin
Russell Jones30-Mar-07 0:00
Russell Jones30-Mar-07 0:00 
AnswerRe: Inheritance and reflection Pin
DavidNohejl29-Mar-07 23:59
DavidNohejl29-Mar-07 23:59 
GeneralRe: Inheritance and reflection Pin
Russell Jones30-Mar-07 0:40
Russell Jones30-Mar-07 0:40 
GeneralRe: Inheritance and reflection Pin
DavidNohejl30-Mar-07 0:54
DavidNohejl30-Mar-07 0:54 
GeneralRe: Inheritance and reflection Pin
Russell Jones30-Mar-07 2:14
Russell Jones30-Mar-07 2:14 
QuestionProblems when removing from ListBox Pin
sinosoidal29-Mar-07 22:56
sinosoidal29-Mar-07 22:56 
AnswerRe: Problems when removing from ListBox Pin
Russell Jones29-Mar-07 23:30
Russell Jones29-Mar-07 23:30 
AnswerRe: Problems when removing from ListBox Pin
sinosoidal30-Mar-07 0:40
sinosoidal30-Mar-07 0:40 
QuestionCreating a custom Vista HotFix INstaller..plz help Pin
ke3p_up29-Mar-07 22:34
ke3p_up29-Mar-07 22:34 
AnswerRe: Creating a custom Vista HotFix INstaller..plz help Pin
stancrm30-Mar-07 0:55
stancrm30-Mar-07 0:55 
GeneralRe: Creating a custom Vista HotFix INstaller..plz help Pin
ke3p_up30-Mar-07 2:00
ke3p_up30-Mar-07 2:00 
GeneralRe: Creating a custom Vista HotFix INstaller..plz help Pin
ke3p_up30-Mar-07 2:45
ke3p_up30-Mar-07 2:45 
QuestionHow to Call AddIn function from App Pin
swje29-Mar-07 22:23
swje29-Mar-07 22:23 
QuestionLoad xml string with ‘&’ sign Pin
anderslundsgard29-Mar-07 21:59
anderslundsgard29-Mar-07 21:59 
AnswerRe: Load xml string with ‘&’ sign Pin
Guffa29-Mar-07 22:01
Guffa29-Mar-07 22:01 
GeneralRe: Load xml string with ‘&’ sign Pin
anderslundsgard30-Mar-07 1:31
anderslundsgard30-Mar-07 1:31 

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.