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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:48:48+00:00 2026-06-09T00:48:48+00:00

I have jquery looping through a html table and putting it into an object

  • 0

I have jquery looping through a html table and putting it into an object then using JSON.stringify to convert that javascript object to json , see json below

{
"0":{"name":"fdgd","surname":"ssdt"},
"1":{"name":"fdsf","surname":"vn"},
"2":{"name":"dfsb","surname":"mry"},
"3":{"name":"hsdsdfry","surname":"smh"}
}

My issue is with JSON.net and the CLASSs im am trying to match up for it to convert the json into my tableT object

After it does the Jsonconvert I get empty objects, can you please tell me what is wrong with my classs. Im using vb.net and .net 2. So I guess my question is how do I match my tableT class up to my json string? Thank you for the help.

Dim tableOBJ As tableT = JsonConvert.DeserializeObject(Of tableT)(myJSON)


Public Class tableT

    Private _allRows As List(Of Rows)

    Property AllRows As List(Of Rows)
        Get
            Return _allRows
        End Get
        Set(ByVal value As List(Of Rows))
            _allRows = value
        End Set
    End Property

End Class

Public Class Rows

    Private _name As String
    Private _surname As String

    Property name As String
        Get
            Return _name
        End Get
        Set(ByVal value As String)
            _name = value
        End Set
    End Property

    Property surname As String
        Get
            Return _surname
        End Get
        Set(ByVal value As String)
            _surname = value
        End Set
    End Property

End Class
  • 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-09T00:48:49+00:00Added an answer on June 9, 2026 at 12:48 am

    Without testing it, it appears that

    JsonConvert.DeserializeObject(Of tableT)(myJSON)
    

    should really be something more like

    JsonConvert.DeserializeObject(Of List(Of Rows))(myJSON)
    

    since there isn’t any way for JsonConvert to know that you want the rows in the AllRows object.

    So, your code would look more like:

    Dim tableOBJ As New tableT 
    tableOBJ.AllRows = JsonConvert.DeserializeObject(Of List(Of Rows))(myJSON)
    

    ** EDIT **

    After testing this, I was only able to get this to work by modifying the Json string to look more like what I understand a Json array should look like.

    Specifically, if I changed the array to look like:

    {"AllRows": [
    {"name":"fdgd","surname":"ssdt"},
    {"name":"fdsf","surname":"vn"},
    {"name":"dfsb","surname":"mry"},
    {"name":"hsdsdfry","surname":"smh"}
    ]}
    

    Then your original code works correctly.

    What your original Json is doing is expecting that there are properties in the class called 0, 1, 2, and 3 of type Rows, which is not possible with VB and is, I am certain, not what you are looking to accomplish.

    You can verify this by adding properties for Zero, One, Two, and Three of type Rows to your tableT:

    Public Class tableT
    
        Public Zero As New Rows
        Public One As New Rows
        Public Two As New Rows
        Public Three As New Rows
    

    changing your json to:

    {
    "Zero":{"name":"fdgd","surname":"ssdt"},
    "One":{"name":"fdsf","surname":"vn"},
    "Two":{"name":"dfsb","surname":"mry"},
    "Three":{"name":"hsdsdfry","surname":"smh"}
    }
    

    and deserializing using your original class. You will see then that the new properties are populated with the contents of your json string.

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

Sidebar

Related Questions

I have a html table that is generated by looping through DB entries. On
I have a setInterval function that calls a for loop, looping through each HTML
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I have a function that is called on document.ready that loops through a table
I am looping through json return values with jQuery's $.each() and adding the classes
I am looking to create an HTML version of a JSON, through JavaScript/jQuery, specifically
I have a question about JQuery Min Max Validation looping through dynamic created input
I am looking into the jQuery UI Resizable method and I have to DIVs
I have jQuery draggable set up and working ok on a table row. Currently
I have JQuery UI Dialog opening on pressing CTRL + Q using the following

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.