B
bryan.kardisco
Perhaps someone can help me with a problem I'm having in respect to
reflection.
I have a custom method that converts a DataSet into an instance of a
class that I've created called row[]
So it looks something like
Code Snippet
private row[] convertDataSets(DataSet dataSet , String tableName)
{
row[] row = null;
row = new row[10];
row[0] = new row();
row[0].ClassA = new ClassA();
}
Now, I've been able to dynamically create ClassA by doing this
Code Snippet
Type tableType =
Type.GetType("MyParentLibrary." + tableName , true);
object tableObject =
Activator.CreateInstance(tableType);
PropertyInfo pI = tableType.GetProperty(columnName);
pI.setValue(object , value , null);
But the question this this: How can I dynamically link this to row[0]
I'd like to just have something like row[0].DynamicClass =
DynamicObject.
Can this be done??
reflection.
I have a custom method that converts a DataSet into an instance of a
class that I've created called row[]
So it looks something like
Code Snippet
private row[] convertDataSets(DataSet dataSet , String tableName)
{
row[] row = null;
row = new row[10];
row[0] = new row();
row[0].ClassA = new ClassA();
}
Now, I've been able to dynamically create ClassA by doing this
Code Snippet
Type tableType =
Type.GetType("MyParentLibrary." + tableName , true);
object tableObject =
Activator.CreateInstance(tableType);
PropertyInfo pI = tableType.GetProperty(columnName);
pI.setValue(object , value , null);
But the question this this: How can I dynamically link this to row[0]
I'd like to just have something like row[0].DynamicClass =
DynamicObject.
Can this be done??