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 6579043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:50:54+00:00 2026-05-25T15:50:54+00:00

I need to query an array. I have tried to use LINQ but with

  • 0

I need to query an array. I have tried to use LINQ but with no success.

Here is a simplified structure of Insurance

Public Class Insurance
       Public _typ As String
        Public _numb As Number()
        Public _indi As Indicator()
End Class

Public Class Number
        Sub New(ByVal n As String, ByVal i As String)
            Me._ntype = n
            Me._value = i
        End Sub
        Public _ntype As String
        Public _value As String

End Class

Public Class Indicator
        Sub New(ByVal it As String, ByVal ind As String)
            Me._itype = it
            Me._ind = ind
        End Sub
        Public _itype As String
        Public _ind As String
End Class

Here I have construct a little example to explain how the array of Insurance looks. In real there is a Service who delivers the array to me.

  Dim insarray(4) As Insurance
  Dim insa As New Insurance
  insa._typ = "SJUKVARD"
  insa._indi = New Indicator() {New Indicator("ST", "G"), New Indicator("TAX", "P"), New Indicator("PT", "6")}
  insa._numb = New Number() {New Number("PIN", "1000"), New Number("AGN", "A0001")}
  insarray(0) = insa

  Dim insa2 As New Insurance
  insa2._typ = "SJUKVARD"
  insa2._indi = New Indicator() {New Indicator("ST", "G"), New Indicator("TAX", "P")}
  insa2._numb = New Number() {New Number("PIN", "2000"), New Number("AGN", "A0002")}
  insarray(1) = insa2

  Dim insa3 As New Insurance
  insa3._typ = "SJUKVARD"
  insa3._indi = New Indicator() {New Indicator("ST", "G"), New Indicator("KAL", "T")}
  insa3._numb = New Number() {New Number("PIN", "3000"), New Number("AGN", "A0003")}
  insarray(2) = insa3

  Dim insa4 As New Insurance
  insa4._typ = "SJUKVARD"
  insa4._indi = New Indicator() {New Indicator("ST", "G"), New Indicator("TAX", "P")}
  insa4._numb = New Number() {New Number("PIN", "4000")}
  insarray(3) = insa4

  Dim insa5 As New Insurance
  insa5._typ = "SJUK"
  insa5._indi = New Indicator() {New Indicator("ST", "F"), New Indicator("TAX", "P")}
  insa5._numb = New Number() {New Number("PIN", "5000"), New Number("AGN", "A0005")}
  insarray(4) = insa5

  Dim myIns As IEnumerable(Of Object)

  myIns = ...(here should to LINQ question be)

In “myIns= …” I want to construct a LINQ query which

  • look for Insurances in the array which have _typ=”SJUKVARD”
  • and in the Insurance _numb array if some of the Number objects has
    _ntype=”AGN”
  • and in the Insurance _indi array if some of the Indicator objects has
    _itype=”TAX”
  • and in the Insurance _indi array if some of the Indicator objects has
    _itype=”ST” AND _ind=”G”
  • and in the Insurance _indi array NOT has a Indicator objects with
    _type=”PT

So the only hit will be Insurance “insa2”. Is this possible with LINQ?

Hope someone can help me 🙂

  • 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-05-25T15:50:54+00:00Added an answer on May 25, 2026 at 3:50 pm
     myIns = insarray.Where(Function(i) i._typ = "SJUKVARD" AndAlso _
              i._numb.Any(Function (n) n._ntype = "AGN") AndAlso _
              i._indi.All(function(ind) (ind._itype <> "PT") AndAlso  _
              (ind._itype = "TAX" OrElse ( ind._itype = "ST" AndAlso ind._ind="G"))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to query the table for all but keyword. Using just - doesn't
I need a query which can do the following operation. I have a table
Rather noobish question but I have tried searching and just cannot find a solution.
I have this query: public function checkUser($phone) { $sql = SELECT name FROM users
I am going nuts here, I have an array of checkboxes from a form
Need your help with my PHP/MYSQL array. I have a php script that selects
I have an array with more than 134675+ values, I need to insert them
I need some help, I have created this function and it works fine, but
I have an array which holds multiple ids's, and i need to to update
I need to build an update query from an associative array from a POST

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.