G
Guest
I have this code
string theClassName = "Rules.FillListBox.FillListBox" + theType + ", Rules"
Type theClass = Type.GetType(theClassName)
Object o = Activator.CreateInstance(theClass)
object[] parameters = new object[2]
parameters [0] = elListBox
parameters [1] = (IList)Session["AdminPaginaBase"]
theClass.GetMethod("fill").Invoke(o, (object[])parameters)
but, when I try to execute the last line, always obtain this error
"Object type cannot be converted to target type.
The problem, I think, is the session object
Any idea how to solve
TIA, Abel
string theClassName = "Rules.FillListBox.FillListBox" + theType + ", Rules"
Type theClass = Type.GetType(theClassName)
Object o = Activator.CreateInstance(theClass)
object[] parameters = new object[2]
parameters [0] = elListBox
parameters [1] = (IList)Session["AdminPaginaBase"]
theClass.GetMethod("fill").Invoke(o, (object[])parameters)
but, when I try to execute the last line, always obtain this error
"Object type cannot be converted to target type.
The problem, I think, is the session object
Any idea how to solve
TIA, Abel