473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Convert code line to VB

Hello,

Could someone, please, convert the following code line to VB.NET?

bool containsValue = myList.Any(item =item.NameParameter ==
nameParameterValue);

(This is .NET 3.5. I couldn't find a converter that does this)

Thanks,
Miguel
Nov 26 '07 #1
2 1292
On Sun, 25 Nov 2007 16:00:26 -0800 (PST), shapper <md*****@gmail.com>
wrote:
>Hello,

Could someone, please, convert the following code line to VB.NET?

bool containsValue = myList.Any(item =item.NameParameter ==
nameParameterValue);

(This is .NET 3.5. I couldn't find a converter that does this)

Thanks,
Miguel
The =introduces a Lambda expression. I don't hve VB2008 installed
right now so I can't verify this, but I think it is:

Dim containsValue as Boolean = myList.Any( Function(item)
item.NameParameter = nameParameterValue )
Nov 26 '07 #2
Miquel,
Jack's answer:

Dim containsValue As Boolean = myList.Any(Function(item)
item.NameParameter = nameParameterValue)

Is correct for the RTM version of VS 2008.

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"shapper" <md*****@gmail.comwrote in message
news:3e**********************************@b15g2000 hsa.googlegroups.com...
Hello,

Could someone, please, convert the following code line to VB.NET?

bool containsValue = myList.Any(item =item.NameParameter ==
nameParameterValue);

(This is .NET 3.5. I couldn't find a converter that does this)

Thanks,
Miguel
Nov 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jason Huang | last post by:
Hi, I would like to convert the following Visual Basic code to C#, does someone has free tool to convert it? Function PreConnect() As Boolean Dim strDSN$, strUidPwd$, strDatabase$,...
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
65
by: kyle.tk | last post by:
I am trying to write a function to convert an ipv4 address that is held in the string char *ip to its long value equivalent. Here is what I have right now, but I can't seem to get it to work. ...
0
by: Mark Parter | last post by:
I'm trying convert an XML Schema (http://www.elframework.org/projects/xcri/efc_r1.0.xsd/view) to a VB.Net class using the XSD tool provided with the .NET 2 SDK. However, it's failing to generate...
14
by: John Smith | last post by:
Can someone convert from C# into VB this line for me: if (c is System.Web.UI.HtmlControls.HtmlForm)
10
by: Gary | last post by:
Hello, Anyone know how to do the following in c# - using inline codeblocks? <% If Request.Form("Name") = "Gary" Then %> <asp:RequiredFieldValidator ID="GarysValidation" ErrorMessage="Gary,...
9
by: olivercfc | last post by:
Hello All, I have a text file in the following format < line 1 line 2 line 3 line < 4 line > 5
5
by: Dave Bootsma | last post by:
I have an application where I want to redraw a polygon from points I retrieve from a file. The file is read with streamreader line by line each line contains the points for each polygon. Below is...
19
by: est | last post by:
From python manual str( ) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that...
14
by: rtillmore | last post by:
Hello, I did a quick google search and nothing that was returned is quite what I am looking for. I have a 200 character hexadecimal string that I need to convert into a 100 character string. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.