Results 1 to 2 of 2

Thread: How do I select field values only with LINQ?

  1. #1

    Thread Starter
    Lively Member Christhemist's Avatar
    Join Date
    Sep 2016
    Location
    Nevada
    Posts
    116

    How do I select field values only with LINQ?

    I am trying to select multiple fields (Account & First) using a LINQ query and I am getting this:

    {Account = 0000000, First = Chris}

    How do I get it to only return the values? Like this: 0000000, Chris

    Here is my code:

    Code:
    Dim both = From row1 In AddressListDatatable.AsEnumerable()
                       Join row2 In Matrix1Datatable.AsEnumerable()
                       On row1.Field(Of String)("Offercode") Equals row2.Field(Of String)("Code")
                       Select Account = row1.Item("Account"), First = row1.Item("First")

  2. #2

    Thread Starter
    Lively Member Christhemist's Avatar
    Join Date
    Sep 2016
    Location
    Nevada
    Posts
    116

    Re: How do I select field values only with LINQ?

    I figured it out:

    Code:
    Dim both = From row1 In AddressListDatatable.AsEnumerable()
                       Join row2 In Matrix1Datatable.AsEnumerable()
                       On row1.Field(Of String)("Offercode") Equals row2.Field(Of String)("Code")
                       Select row1("Account"), row1("First")

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width