D
Daisy
What I want to do is this:
Object1[] list = (Object1[])this.MyMethod(typeOf(Object1), "Object1",
"string1", "string2");
and
Object2[] list = (Object2[])this.MyMethod(typeOf(Object2), "Object2",
"string1");
But I can't find how to call a constructor from a type
// Do I have to return object[]?
public object[] MyMethod(Type t, string name, params object[] spParams)
{
DataReader dr = Data.Get(name, spParams);
retVal = new t.Construct(dr); // <-- THIS LINE NEEDS TO CALL CONSTRUCTOR
return (object[])retVal;
}
I've tried msdn, but can't find what I'm looking for
Object1[] list = (Object1[])this.MyMethod(typeOf(Object1), "Object1",
"string1", "string2");
and
Object2[] list = (Object2[])this.MyMethod(typeOf(Object2), "Object2",
"string1");
But I can't find how to call a constructor from a type
// Do I have to return object[]?
public object[] MyMethod(Type t, string name, params object[] spParams)
{
DataReader dr = Data.Get(name, spParams);
retVal = new t.Construct(dr); // <-- THIS LINE NEEDS TO CALL CONSTRUCTOR
return (object[])retVal;
}
I've tried msdn, but can't find what I'm looking for