Syed Muhammad Kamruzzaman Syed Muhammad Kamruzzaman - 1 year ago 197 Question

Use of List.Find in VB.NET

I have two columns. One column contains string values and another column contains decimal values. I want to select the decimal value by selecting the string value.

string decimal
Jewel 10
Hasan 20

How do I select Jewel so it will return 10?

Answer Source

Try this:

Dim selectedValues As List(Of InvoiceSOA)
selectedValues = DisputeList.FindAll(Function(p) p.ColumnName = "Jewel")

Or, if you need the first occurence of "Jewel" use this:

Dim selectedValue As InvoiceSOA
selectedValue = DisputeList.Find(Function(p) p.ColumnName = "Jewel")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download