Click here to Skip to main content
15,908,834 members
Home / Discussions / C#
   

C#

 
GeneralRe: Writing binary data to file Pin
bouli1-Sep-05 10:07
bouli1-Sep-05 10:07 
GeneralRe: Writing binary data to file Pin
Guffa1-Sep-05 11:24
Guffa1-Sep-05 11:24 
GeneralRe: Writing binary data to file Pin
bouli2-Sep-05 5:38
bouli2-Sep-05 5:38 
AnswerRe: Writing binary data to file Pin
Stanciu Vlad1-Sep-05 10:09
Stanciu Vlad1-Sep-05 10:09 
GeneralRe: Writing binary data to file Pin
bouli1-Sep-05 10:12
bouli1-Sep-05 10:12 
GeneralRe: Writing binary data to file Pin
Stanciu Vlad1-Sep-05 10:46
Stanciu Vlad1-Sep-05 10:46 
GeneralRe: Writing binary data to file Pin
Dan Neely1-Sep-05 10:57
Dan Neely1-Sep-05 10:57 
QuestionValidating what's in TextBox: Basics Pin
...---...1-Sep-05 9:21
...---...1-Sep-05 9:21 
AnswerRe: Validating what's in TextBox: Basics Pin
Stanciu Vlad1-Sep-05 9:57
Stanciu Vlad1-Sep-05 9:57 
QuestionHow can we know if Scroll bars are active? Pin
rudy.net1-Sep-05 9:14
rudy.net1-Sep-05 9:14 
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 

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.