M
MDBloemker
Based on the answers to my first post, I've spent some time boning up on
Reflection. Everything I find has Reflection being used against a class, but
what I'm looking for is some way to do the same thing, but against an
mvar = marray(3) ' array element holding a ColumnName, such as SRType
SRObj(mvar) = datareader(mvar) ' SRObj.Member = datareader.ColumnnameValue
where the name of the Member is the same as the ColumnName, such as SRType
The datareader part works fine. The object part insists on a default
property, but when I give it one, it insists on assigning the value of the
datareader column only to the PropertyName part of the function (that is,
Default Property Whatsis(ByVal mvar as String) as String returns the value
of the column SRType into the instance's Whatsis member. Close, but no
cigar.) I feel as though I'm missing an important step, or even a whole
concept. Does Reflection work at all on a class instance? Is my thinking
even in the right place??
MDBloemker
(e-mail address removed)
Reflection. Everything I find has Reflection being used against a class, but
what I'm looking for is some way to do the same thing, but against an
The ultimate goal being to be able to do the following:instance< of the class, such as SRObj as an instance of the cls_SR class.
mvar = marray(3) ' array element holding a ColumnName, such as SRType
SRObj(mvar) = datareader(mvar) ' SRObj.Member = datareader.ColumnnameValue
where the name of the Member is the same as the ColumnName, such as SRType
The datareader part works fine. The object part insists on a default
property, but when I give it one, it insists on assigning the value of the
datareader column only to the PropertyName part of the function (that is,
Default Property Whatsis(ByVal mvar as String) as String returns the value
of the column SRType into the instance's Whatsis member. Close, but no
cigar.) I feel as though I'm missing an important step, or even a whole
concept. Does Reflection work at all on a class instance? Is my thinking
even in the right place??
MDBloemker
(e-mail address removed)