Hello. I am having trouble finding the solution to my problem. I created instances of two classes using Activator.CreateInstance and Reflection. The first class contains properties that are filled with values from code. The second class saves the class in it by using the "Insert" method. For some reason, I keep getting an error. How would I go about accomplishing this? This is what I have, but it does not seem to work.
Code Snippet
MethodInfo myMethod = t2.GetMethod("Insert"); //Gets the insert method in the 2nd class
myMethod.Invoke(Class2Object,Class1Object
);
It gives me the error: "Cannot convert object to object[]." Is there a way around this?