Click here to Skip to main content
15,897,519 members
Home / Discussions / C#
   

C#

 
QuestionMinimize button event Pin
ngensys1-Sep-05 8:50
ngensys1-Sep-05 8:50 
AnswerRe: Minimize button event Pin
Stanciu Vlad1-Sep-05 9:43
Stanciu Vlad1-Sep-05 9:43 
AnswerRe: Minimize button event Pin
Bojan Rajkovic1-Sep-05 16:30
Bojan Rajkovic1-Sep-05 16:30 
QuestionWeb Custom Controls - ASP.NET 2.0 Pin
kalakrishna1-Sep-05 8:46
kalakrishna1-Sep-05 8:46 
Questionarray Pin
HFreitas1-Sep-05 8:04
HFreitas1-Sep-05 8:04 
AnswerRe: array Pin
Stanciu Vlad1-Sep-05 9:01
Stanciu Vlad1-Sep-05 9:01 
QuestionReflection Ambiguous match error Pin
PhrankBooth1-Sep-05 7:40
PhrankBooth1-Sep-05 7:40 
AnswerRe: Reflection Ambiguous match error Pin
Judah Gabriel Himango1-Sep-05 7:55
sponsorJudah Gabriel Himango1-Sep-05 7:55 
Use any of the overloads for the GetMethod call. You'll notice that there are several GetMethod functions: GetMethod(string), GetMethod(string, Type[]), and so on. The ambiguouse match exception is being thrown because the method you're trying to retrieve has overloads as well. For instance, let's say you're trying to retrieve the SayHello function:

void SayHello(string message)
{
}

void SayHello(string message, bool waveHandAsFriendlyGesture)
{
}


So, you want to retrieve the SayHello method. Let's pretend you want to retrieve the overloaded method that takes both a string message and a bool waveHand. Currently, you're trying to access it like this:

theType.GetMethod("SayHello"); // ambiguous match exception: both SayHello methods take at least a string.


To prevent this error from occuring, use the GetMethod overload that takes a type array, allowing you to specify the types of the arguments:

theType.GetMethod("SayHello", new Type[] { typeof(string), typeof(bool) }); // yay, no exceptions!


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango


QuestionRe: Reflection Ambiguous match error Pin
PhrankBooth1-Sep-05 9:05
PhrankBooth1-Sep-05 9:05 
AnswerRe: Reflection Ambiguous match error Pin
Judah Gabriel Himango1-Sep-05 10:07
sponsorJudah Gabriel Himango1-Sep-05 10:07 
Questioncombobox XML Pin
PHDENG811-Sep-05 7:30
PHDENG811-Sep-05 7:30 
AnswerRe: combobox XML Pin
Judah Gabriel Himango1-Sep-05 7:47
sponsorJudah Gabriel Himango1-Sep-05 7:47 
GeneralRe: combobox XML Pin
PHDENG811-Sep-05 8:17
PHDENG811-Sep-05 8:17 
GeneralRe: combobox XML Pin
PHDENG811-Sep-05 8:36
PHDENG811-Sep-05 8:36 
GeneralRe: combobox XML Pin
Judah Gabriel Himango1-Sep-05 9:21
sponsorJudah Gabriel Himango1-Sep-05 9:21 
QuestionCurves and Angles Pin
suresh sahu1-Sep-05 7:09
suresh sahu1-Sep-05 7:09 
AnswerRe: Curves and Angles Pin
Judah Gabriel Himango1-Sep-05 7:45
sponsorJudah Gabriel Himango1-Sep-05 7:45 
GeneralRe: Curves and Angles Pin
suresh sahu3-Sep-05 20:28
suresh sahu3-Sep-05 20:28 
Questionloading a com clientside. HELP!! Pin
femi ojemuyiwa1-Sep-05 7:04
femi ojemuyiwa1-Sep-05 7:04 
QuestionPasteSpecial into Word Pin
Rick Beideman1-Sep-05 6:33
Rick Beideman1-Sep-05 6:33 
QuestionRegex "Unrecognized Escape Seq?" Pin
...---...1-Sep-05 6:05
...---...1-Sep-05 6:05 
AnswerRe: Regex "Unrecognized Escape Seq?" Pin
S. Senthil Kumar1-Sep-05 6:14
S. Senthil Kumar1-Sep-05 6:14 
AnswerRe: Regex "Unrecognized Escape Seq?" Pin
Guffa1-Sep-05 6:21
Guffa1-Sep-05 6:21 
AnswerRe: Regex "Unrecognized Escape Seq?" Pin
hamster11-Sep-05 16:20
hamster11-Sep-05 16:20 
QuestionRotating an image Pin
suresh sahu1-Sep-05 6:05
suresh sahu1-Sep-05 6:05 

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.