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

  • Home
  • SEARCH
  • 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 6804111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:25:34+00:00 2026-05-26T19:25:34+00:00

I’ve got the following JSON string to deserialize: [{application_id:1,application_package:abc},{application_id:2,application_package:xyz}] I’m using DataContractJsonSerializer method. It

  • 0

I’ve got the following JSON string to deserialize:

[{"application_id":"1","application_package":"abc"},{"application_id":"2","application_package":"xyz"}]

I’m using DataContractJsonSerializer method.

It is made up of array of items and I couldn’t find an example using VB.Net that can deserialize this structure. I have the following Application class to store this information:

    <DataContract(Namespace:="")> _
    Public Class ApplicationItem

    <DataMember(Name:="application_id")>
    Public Property application_id As String

    <DataMember(Name:="application_package")>
    Public Property application_package As String

    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-05-26T19:25:35+00:00Added an answer on May 26, 2026 at 7:25 pm

    I’d recommend you to use JavaScriptSerializer over DataContractJsonSerializer. The reasons are:

    • JavaScriptSerializer is faster over DataContractJsonSerializer
    • DataContractJsonSerializer requires more code than JavaScriptSerializer for a simple serialization.

    You won’t need the DataContract and DataMember attribute to use along with JavaScriptSerializer

    Use this data class

    <Serializable> _
    Public Class ApplicationItem
        Public Property application_id() As String
            Get
                Return m_application_id
            End Get
            Set
                m_application_id = Value
            End Set
        End Property
        Private m_application_id As String
        Public Property application_package() As String
            Get
                Return m_application_package
            End Get
            Set
                m_application_package = Value
            End Set
        End Property
        Private m_application_package As String
    End Class
    

    And use this to deserialize your jsonText:

    Dim jss As New JavaScriptSerializer()
    Dim dict = jss.Deserialize(Of List(Of ApplicationItem))(jsonText)
    

    If you still want to use DataContractJsonSerializer, you can use this code below to deserialize:

    Dim obj As New List(Of ApplicationItem)()
    Dim ms As New MemoryStream(Encoding.Unicode.GetBytes(json))
    Dim serializer As New System.Runtime.Serialization.Json.DataContractJsonSerializer(obj.[GetType]())
    obj = DirectCast(serializer.ReadObject(ms), List(Of ApplicationItem))
    ms.Close()
    ms.Dispose()
    

    Courtesy: Used Telerik Code Converter

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
i got an object with contents of html markup in it, for example: string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
Specifically, suppose I start with the string string =hello \'i am \' me And

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.