Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8893865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:21:19+00:00 2026-06-14T23:21:19+00:00

Please have a look at the code below. Dim results As IEnumerable(Of Customer) =

  • 0

Please have a look at the code below.

Dim results As IEnumerable(Of Customer) = ExecuteDataReader( _
               "SELECT * FROM Customer WHERE Sales> @MinSales", _
          Sub(p) p.Add("@MinSales", SqlDbType.Double).Value = 10000.0, _
          Function(r) New Customer() With {Name=r("Name"), Address=r("Address"), Sales=r("Sales") })

For Each c As Customer in results
   '...
Next

In a previous question I posted, the answerer posted this code. I do not understand the sub(p) or function(r) part of the code.

Unfortunately I have no basis to search for an answer to this. Therefore I have posted this question after completing a limited amount of research.

What is meant by sub(p) and function(r) ?

Update 14:54

Please see below. What is meant by: (Of T) and ByVal castRow As Function(Of IDataRecord, T)?

Public Iterator Function ExecuteDataReader(Of T)(ByVal sql As String,
ByVal addParams as Action(Of SqlParameterCollection), ByVal castRow As
Funnction(Of IDataRecord, T)) As IEnumerable(Of T)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:21:20+00:00Added an answer on June 14, 2026 at 11:21 pm

    Lambda Expressions:

    A lambda expression is a function or subroutine without a name that can be used wherever a delegate is valid. Lambda expressions can be functions or subroutines and can be single-line or multi-line. You can pass values from the current scope to a lambda expression.

    Dim increment1 = Function(x) x + 1
    Dim increment2 = Function(x)
                         Return x + 2
                     End Function 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please have a look at the code below: import string from collections import defaultdict
Please have a look at the code below (excerpt from a C# book): public
I come from a Java background. Please have a look at the code below
Please have a look on the code below .. <div id=click_me>Save</div> <div id=blocks_sortable> <div
Could you please have a look at my code below. #!C:\Perl\bin\perl.exe use strict; use
Please have a look at the code below: Class A package generalscenarios; public class
Please have a look at the code below: - (NSArray *)requestEntities:(NSString *)entityName { NSFetchRequest
Please have a look at the below SQL code. DECLARE @RET TABLE(OID BIGINT NOT
Please have a look to below code function GetAreaName($AreaCode) { switch ($AreaCode) { case
Please have a look on code written below. I am trying to have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.