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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:27:26+00:00 2026-06-03T17:27:26+00:00

I am attempting to create a class in vb.net from the below JSON example.

  • 0

I am attempting to create a class in vb.net from the below JSON example.

I am fairly new to JSON, and I am just having trouble figuring out the correct way of doing this. I have looked at numerous examples of how to do this but they are in much simpler formats than the one I am providing below.

LEVEL0({
  "LEVEL1": [
    {
      "LEVEL2": [
        {
          "City": "Billings",
          "State": "MO",
          "Country": "US",
          "Id": "1122334455",
          "Percent": "39.10"
          }
      ],
      "City": "Billings",
      "Country": "US",
      "NumFound": "1",
      "NumReturned": "1",
      "State": "MO",
      "Status": "Success"
    }
  ],
  "Status": "1"
});

I was thinking that this would be fairly easy, but what is causing me issues is that LEVEL2 is a list. It could return back multiple cities. So, it could return something like this within the [].

{"City": "Billings","State": "MO","Country": "US","Id": "1122334455","Percent": "39.10"},
{"City": "Fairmount","State": "MN","Country": "US","Id": "1177775","Percent": "64.10",}

So either way that portion needs to be a list, but then the portion below the list needs to be part of that class also. Where you see numFound.

I am guessing this is poorly worded, but I am struggling to find a good example of how this would be done. Any direction or advice on this would be greatly appreciated. I need to have the class correctly formatted so when I deserialize into the class it works without error.

  • 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-03T17:27:30+00:00Added an answer on June 3, 2026 at 5:27 pm

    If you’re using a webservice of some sort, it should automatically bind for you if you are using an object that has all of these properties. Something like:

    Public Class WrapperClass
        Dim Status As Integer
        Dim LEVEL1 As New List(Of MiddleClass)
    End Class
    
    Public Class MiddleClass
        Dim LEVEL2 As New List(Of InnerClass)
        Dim City As String
        Dim Country As String
        Dim NumFound As Integer
        Dim NumReturned As Integer
        Dim State As String
        Dim Status As String
    
        Public Sub MiddleClass()
        'init code
        End Sub
    End Class
    
    Public Class InnerClass
        Dim City As String
        Dim Country As String
        Dim State As String
        Dim Id As Integer
        Dim Percent As Decimal
    End Class
    

    Then in your webservice, have it accept a parameter of type WrapperClass

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to send emails from my C# app using the System.Net.Mail.MailMessage class. For
I'm attempting to create a custom calendar control that inherits from ASP.Net's built in
I am attempting to write out an Excel file from an ASP.NET web server
I am attempting to create a template AutoClass that create an arbitrary class with
I'm attempting to create a generic controller, ie: public class MyController<T> : Controller where
Im attempting to create a new operator :? on lists, which operates the same
I am fairly new to .NET C# development and recently started using LINQ to
I'm attempting to create a class with many parameters, using a Builder pattern rather
I'm attempting to create themeing system for my asp.net mvc application. I was able
I am attempting to create a script that wraps a Groovy class that will

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.