O
OldButStillLearning
I am trying to use reflection to create an instance of a class which I have a
"text" name to work with to create the object.
The Class that I want to create and instance of has a constructor which
takes a "DataRow" as input.
So as I understand it, one of the things I have to do is create an object
array contains all of the "Types" that are used in the constructor. I have
tried to create an instance of the Type by using the following command:
Type.GetType("System.Data.DataRow", true, true)
This apparently defaults information which was not supplied and I apparently
have to supply more information as part of the 1st parm of the GetType to
properly identify where the information is which will allow the "Type" to be
created.
I have located the System.Data.dll and selected properties on this in
windows explorer. I believe that I must provide Version, but there are a few
specified in the properties, which do I select? I believe I have to supply
Culture and PublicKeyToken, not sure what to provided - maybe not all of
these are required for it to be successful, not sure.
Secondly - Can I programatically retrieve this information so that if this
changes with new releases of the Framework I will not have to change my
program and recompile?
Thanks in advance for your assistance!!!!
"text" name to work with to create the object.
The Class that I want to create and instance of has a constructor which
takes a "DataRow" as input.
So as I understand it, one of the things I have to do is create an object
array contains all of the "Types" that are used in the constructor. I have
tried to create an instance of the Type by using the following command:
Type.GetType("System.Data.DataRow", true, true)
This apparently defaults information which was not supplied and I apparently
have to supply more information as part of the 1st parm of the GetType to
properly identify where the information is which will allow the "Type" to be
created.
I have located the System.Data.dll and selected properties on this in
windows explorer. I believe that I must provide Version, but there are a few
specified in the properties, which do I select? I believe I have to supply
Culture and PublicKeyToken, not sure what to provided - maybe not all of
these are required for it to be successful, not sure.
Secondly - Can I programatically retrieve this information so that if this
changes with new releases of the Framework I will not have to change my
program and recompile?
Thanks in advance for your assistance!!!!