Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help converting C# to VB

Status
Not open for further replies.

mspain

IS-IT--Management
Mar 17, 2002
100
US
Hi all,

I need some help. I am trying to convert some C# code to VB but I don't know either very well so I was hoping someone could help.

Here is the C# code:

Comparison<MembershipUserWrapper> comparison = null;

comparison = new Comparison<MembershipUserWrapper>(
delegate(MembershipUserWrapper lhs, MembershipUserWrapper rhs)
{
return lhs.UserName.CompareTo(rhs.UserName);
}
);

Thanks for your time!
 
Thanks for the reply. I tried using that and it errors out saying:

An error occured while processing your code: -- line 2 col 11: invalid StatementExpr

It doesn't seem to like the <> around MembershipUserWrapper. Any other ideas?

Thanks a lot!
 
probably something like this

dim comparison as Comparison(of MembershipUserWrapper) = null

private delegate function delwrapper(MembershipUserWrapper lhs, MembershipUserWrapper rhs) as boolean
private del as new delwrapper (addressof thinghatdoesthing)

comparison = new Comparison(of MembershipUserWrapper)(del)

private function thingthatdoesthing(MembershipUserWrapper lhs, MembershipUserWrapper rhs) as boolean
return lhs.UserName.CompareTo(rhs.UserName)
end function


I don't think that the inline method will work in vb.net.


Christiaan Baes
Belgium

"My new site" - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top