title: Converting C# code to VB.Net: no accessible 'Select' can be called with these arguments
body: <p>I tried to convert a C# code to VB language and I get the following error: </p>
  
  <blockquote>
    <p>Error 231 Overload resolution failed because no accessible 'Select'
    can be called with these arguments:
        Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of System.Data.IDataRecord, Integer, TResult)) As
    System.Collections.Generic.IEnumerable(Of TResult)' defined in
    'System.Linq.Enumerable': Nested function does not have a signature
    that is compatible with delegate 'System.Func(Of
    System.Data.IDataRecord, Integer, TResult)'.
        Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of System.Data.IDataRecord, Integer, TResult)) As
    System.Collections.Generic.IEnumerable(Of TResult)' defined in
    'System.Linq.Enumerable': Data type(s) of the type parameter(s) cannot
    be inferred from these arguments. Specifying the data type(s)
    explicitly might correct this error.
        Extension method 'Public Function Select(Of TResult)(selector As System.Func(Of System.Data.IDataRecord, TResult)) As
    System.Collections.Generic.IEnumerable(Of TResult)' defined in
    'System.Linq.Enumerable': Data type(s) of the type parameter(s) cannot
    be inferred from these arguments. Specifying the data type(s)
    explicitly might correct this error.  C:\Users\Admin\Documents\Visual
    Studio
    2010\Projects\SalesRepProject\SalesRep\Code\Job\JobInfoRepository.vb  25  13  SalesRep</p>
  </blockquote>
  
  <p>Here is the code for C#:</p>
  
  <pre><code> using (var reader = command.ExecuteReader())
         return reader.Cast&lt;IDataRecord&gt;()
             .Select(x =&gt; new JobInfo(){ 
                 JobID = x.GetInt32(0), 
                 Name = x.GetString(1), 
                 LastExecutionDate = x.GetDateTime(2),  
                 Status  = x.GetString(3) 
             }).ToList();
  </code></pre>
  
  <p>and here is the code for VB:</p>
  
  <pre><code> Using reader = command.ExecuteReader()
      Return reader.Cast(Of IDataRecord)().[Select](Function(x) New JobInfo() With { _
          Key .JobID = x.GetInt32(0), _
          Key .Name = x.GetString(1), _
          Key .LastExecutionDate = x.GetDateTime(2), _
          Key .Status = x.GetString(3) _
      }).ToList()
  </code></pre>
  
  <p>any idea please. Thank you in advance</p>