Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: Tessellations Pin
Mark Churchill2-Sep-07 21:12
Mark Churchill2-Sep-07 21:12 
Questionaccess violation Pin
Opa Knack2-Sep-07 9:19
Opa Knack2-Sep-07 9:19 
AnswerRe: access violation Pin
Christian Graus2-Sep-07 9:31
protectorChristian Graus2-Sep-07 9:31 
GeneralRe: access violation Pin
Opa Knack2-Sep-07 10:47
Opa Knack2-Sep-07 10:47 
GeneralRe: access violation Pin
Christian Graus2-Sep-07 11:10
protectorChristian Graus2-Sep-07 11:10 
QuestionMain Method... Pin
Amit Kumar G2-Sep-07 8:58
Amit Kumar G2-Sep-07 8:58 
AnswerRe: Main Method... Pin
Christian Graus2-Sep-07 9:03
protectorChristian Graus2-Sep-07 9:03 
Questionforce GetMethod() to return parameterless method Pin
AndrusM2-Sep-07 8:27
AndrusM2-Sep-07 8:27 
Class MyClass contains a number of FindAll() methods in parent classes:

class MyClass: ActiveRecordBase<myclass> {... }

public abstract class ActiveRecordBase<t> : ActiveRecordBase {
protected ActiveRecordBase();
public static T[] FindAll();
public static T[] FindAll(params ICriterion[] criteria);
public static T[] FindAll(DetachedCriteria criteria, params Order[] orders);
public static T[] FindAll(Order order, params ICriterion[] criteria);
public static T[] FindAll(Order[] orders, params ICriterion[] criteria);
...
}

public abstract class ActiveRecordBase : ActiveRecordHooksBase {
protected ActiveRecordBase();
protected internal static Array FindAll(Type targetType);
protected internal static Array FindAll(Type targetType, params ICriterion[]
criteria);
protected internal static Array FindAll(Type targetType, DetachedCriteria
detachedCriteria, params Order[] orders);
protected internal static Array FindAll(Type targetType, Order[] orders,
params ICriterion[] criteria);
...


I need to invoke MyClass parameterless FindAll() method using Reflection.
I tried the following code but GetMethod() returns Ambiquous match found
exception.
How to run parameterless FindAll() method ?
How to add required method signature to GetMethod() parameters or other
solution ?

Type t = Type.GetType("MyClass, MyDll");

// this line causes Ambiquous match found exception :
MethodInfo mi = t.GetMethod("FindAll",
BindingFlags.Public |
BindingFlags.FlattenHierarchy |
BindingFlags.Static);

IList<object> list = (IList<object>)mi.Invoke(null, null);

Andrus



Andrus

AnswerRe: force GetMethod() to return parameterless method Pin
Nissim Salomon2-Sep-07 9:42
Nissim Salomon2-Sep-07 9:42 
QuestionUse 'objects' from other functions Pin
Kristian Sixhøj2-Sep-07 7:47
Kristian Sixhøj2-Sep-07 7:47 
AnswerRe: Use 'objects' from other functions Pin
mav.northwind2-Sep-07 7:57
mav.northwind2-Sep-07 7:57 
GeneralRe: Use 'objects' from other functions Pin
Kristian Sixhøj2-Sep-07 8:00
Kristian Sixhøj2-Sep-07 8:00 
GeneralRe: Use 'objects' from other functions Pin
mav.northwind2-Sep-07 8:05
mav.northwind2-Sep-07 8:05 
GeneralRe: Use 'objects' from other functions Pin
Kristian Sixhøj2-Sep-07 8:20
Kristian Sixhøj2-Sep-07 8:20 
AnswerRe: Use 'objects' from other functions Pin
Guffa2-Sep-07 8:24
Guffa2-Sep-07 8:24 
GeneralRe: Use 'objects' from other functions Pin
Pete O'Hanlon2-Sep-07 9:50
mvePete O'Hanlon2-Sep-07 9:50 
AnswerRe: Use 'objects' from other functions Pin
Christian Graus2-Sep-07 8:35
protectorChristian Graus2-Sep-07 8:35 
QuestionCode execution time Pin
Heba Ghoz2-Sep-07 7:38
Heba Ghoz2-Sep-07 7:38 
AnswerRe: Code execution time Pin
Guffa2-Sep-07 8:34
Guffa2-Sep-07 8:34 
GeneralRe: Code execution time Pin
Paul Conrad2-Sep-07 11:04
professionalPaul Conrad2-Sep-07 11:04 
GeneralRe: Code execution time Pin
Guffa3-Sep-07 0:41
Guffa3-Sep-07 0:41 
GeneralRe: Code execution time Pin
Paul Conrad3-Sep-07 5:46
professionalPaul Conrad3-Sep-07 5:46 
QuestionIterate through the class Pin
d97kti2-Sep-07 7:36
d97kti2-Sep-07 7:36 
AnswerRe: Iterate through the class Pin
Christian Graus2-Sep-07 7:38
protectorChristian Graus2-Sep-07 7:38 
GeneralRe: Iterate through the class Pin
d97kti2-Sep-07 8:53
d97kti2-Sep-07 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.