Travis,
You're right, C# sees only the full signature for the method and won't
compile because it doesn't see multiple overloaded versions.

Which is a bummer (could have sworn it worked), but is not
insurmountable.  You just need to send the default value(s) for the
optional parameter(s).  These you can find very simply using
reflection. Here's a quick example...

VB.NET code
Public Class VBOptionalParmDemo

    Public Shared Function OptionalDemo(ByVal s As String, Optional
ByVal os As String = "No Optional Parm Supplied") As String
        Return s & ":" & os
    End Function

End Class

C# code for calling VB.NET method...
Type t = typeof(VBOptionalParmDemo);
MethodInfo mi = t.GetMethod("OptionalDemo");
ParameterInfo[] ps = mi.GetParameters();

//call the VB method sending it the default value of the optional parameter
Console.WriteLine(VBOptionalParmDemo.OptionalDemo("Without",
(string)ps[1].DefaultValue));

//supply your own
Console.WriteLine(VBOptionalParmDemo.OptionalDemo("With", "I Supplied
this value"));
Console.Read();


HTH,

-- 
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to