Working with nested json file

Hi, i have a nested json file that i want to deserialize, i keep getting an error " Object reference not set to an instance of an object."
here is my json file
"Name": "Junius",
"LastName": "Lekgwara",
"CellNo": [
"CellC": "072685345",
"Voda": "0728589303"
"Name": "Phuti",
"LastName": "Gravel",
"CellNo": [
"CellC": "08377777777",
"Voda": "089888888888"
"Name": "Donald",
"LastName": "Gravel",
"CellNo": [
"CellC": "0791408989",
"Voda": "0117689009"
here is my Person class
Public Class Person
Private _Name As String
Public Property Name() As String
Get
Return _Name
End Get
Set(ByVal value As String)
_Name = value
End Set
End Property
Private _LastName As String
Public Property LastName() As String
Get
Return _LastName
End Get
Set(ByVal value As String)
_LastName = value
End Set
End Property
Public Property cellno As CellNo
End Class
Public Class CellNo
Public Property CellC As String
Public Property Voda As String
End Class
PersonList class
Public Class PersonList
Private _ListPerson As List(Of Person)
Public Property ListPerson() As List(Of Person)
Get
Return _ListPerson
End Get
Set(ByVal value As List(Of Person))
_ListPerson = value
End Set
End Property
Sub New()
_ListPerson = New List(Of Person)
End Sub
End Class
reading json file, when this sub is called i get an error
Public Async Sub LoadFromFile()
Dim reader As String = Await GetFile()
Dim serializer As DataContractJsonSerializer = New DataContractJsonSerializer(GetType(ObservableCollection(Of Person)))
Dim ms As MemoryStream = New MemoryStream(Encoding.UTF8.GetBytes(reader))
Dim listOf As ObservableCollection(Of Person) = New ObservableCollection(Of Person)
listOf = serializer.ReadObject(ms)
For Each item In listOf
list.ListPerson.Add(item)
Debug.WriteLine(item.Name + " " + item.LastName + " " + item.cellno.CellC + " " + item.cellno.Voda) 'Object reference not set to an instance of an object, on item.cellno.CellC and item.cellno.Voda
Next
End Sub
how can i fix this?

in your model its just a property. in your json its a list. you have this:
 "CellNo": [
"CellC": "0791408989",
"Voda": "0117689009"
and should be
 "CellNo": 
"CellC": "0791408989",
"Voda": "0117689009"
Microsoft Certified Solutions Developer - Windows Store Apps Using C#

Similar Messages

  • Working with old PDF files - Release Clipping Masks

    Hi Everyone....Please Help Me!
    I am regularly required to work with old pdf files for my company, which I have to open in Illustrator to amend and update (we don't have access to the original .ai files).
    Whenever I start to work on these files I have to spend ages just unconnecting the elements of the artwork, usually by right clicking and choosing "release clipping mask"
    Is there a way to just disconnect everything when you open up an old pdf document in Illustrator?
    Tá mo chroi bhríste
    (it has my heart broken - in Irish!)

    Always keeping a careful eye on the effects of released clipping masks, the process can be accelerated using the keyboard shortcuts rather than hunt-and-click.
    Open the PDF.
    Ctrl/Cmd+A (Select All)
    Ctrl/Cmd+Alt/Opt+7 (Object > Clipping Mask > Release) Hold down Ctrl/Cmd+Alt/Opt and tap the 7 key repeatedly to initially release all top-level masks, then continue through the levels of nesting that may be present. With Show Bounding Box and Show Edges active it's easy to see when the releasing has stopped...usually only a few levels.
    Deselect, then find one of the orphaned mask objects, which will have a fill and stroke of None. Select it, then choose Object > Select > Same > Fill & Stroke to select all the orphaned mask objects.
    Delete.

  • Raw files from the new Nikon D810 will not open with either Photoshop CS5.1 or Lightroom 4.  When will a real Adobe solution be available to work with Raw (NEF) files in their native format, using CS5.1 and LR4?

    Raw files from the new Nikon D810 will not open with either Photoshop CS5.1 or Lightroom 4.  When will a real Adobe solution be available to work with Raw (NEF) files in their native format, using CS5.1 and LR4?

    Clarification: this is a user forum; you are not addressing Adobe here.
    The answer to your question as phrased is: never.
    CS5 is history and it is not longer supported.  There will not be any updates or bug fixes for CS5.
    You need to convert the raw NEF files from your D810 to raw DNGs using the free, standalone Adobe DNG Converter 8.6 RC (beta), the first version ever to support that camera.. 

  • Advice needed: The way to solve out of memory problem (or the way to work with big csv files)

    Hello:)
    I'm in trouble: I have a big csv file (over 5gb of web-analytics data) and my 64 bit excel (and 6gb ram)
    I cant load file to data model because of it's size. There is an error "out of memory" in power query. 
    This is the first time when I encountered such a problem.
    What options do I have to work with such a file? To increase memory in my computer? Would it solve the problem? How much do I need to work with 6gb csv? 
    Or may be I can upload my data somewhere to azure and work with it there? 
    So the problem - is there any way to deal with big files using power query? Or I need to become a developer and learn sql or other languages? 
    Thanks in advance.
    Max

    Hi Miguel!
    Thanks for your answer. 
    I've tried to load this file on virtual pc from azure cloud with this config:
    I have increased memory limit in power query settings:
    And still, the proble is the same:
    What I do wrong? 

  • Working with in-memory files

    This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSe9cbe5cf462523a0-70e2363b121825b2 0e7-8000.html

    Under Writing and executing dynamic CFM files, <cfoutput>a.jpg Doesn't exists</cfoutput> should be <cfoutput>a.jpg doesn't exist</cfoutput>.
    Under Working with in-memory file system, <cfcomponent name="a" extends"b"> should be <cfcomponent name="a" extends="b">.

  • I need to work with the RAW files on a SONY RX100III. I use Photoshop CS5 and a Mac operating system OSX 10.6.

    I need to work with the RAW files on a SONY RX100III camera. I use Photoshop CS5 and a Mac operating system OSX 10.6. Is there an Camera RAW upgrade or an alternative program that works here?

    You don't. Since you have an Intel Mac, buy a Mac OS X 10.6 DVD from the online Apple Store.
    (71894)

  • Question. How do I update / modify my site? Do I work with the original file "modify"?

    How do I update / modify my site? Do I work with the original file "modify"?

    Not sure why modify is in quotes ... but yes you work with the original and then publish again or export the HTML again.

  • Working with bootstrap css file after opening the browser

    working with bootstrap css file after opening the browser when i came back on working on bootstrap my computer started hanging and opning new tabs  and showing message " A caused the program to stop working correctly.Windows will close thoe program and notify you if  solution is available"

    Hi Geetha,
    1.) button problem:
    i don't know how you open the form - when you do it with a XML file maybe you packed the wrong XML file into your addon installer.
    2.) the flickering can be a problem of formatted searches or interacting with other addons.
    when addon a. changes a field it can be that addon b. does something because of the event from addon a.
    the same can happen when you have formatted searches that do something when a field changes.
    ok - that are my last tipps for this day
    good night
    David

  • Working with HD m2ts files to get best video out burned on disk.

    Working with m2ts video files, how to get best video output.  I have Pinnacle 12U and the video picture that is produced on a burned disk is much better then what is produced in Adobe Premieme PRO CS4.  I would like to continue to use Premieme Pro, but unless I can archive at least the same quality of video it would be hard to make the switch.  I must be missing something???  HELP!!

    More input,  the media file output is VTS.VOB format from Adobe and from Pinnacle it is m2ts.  When you stop the playback m2ts is real sharp and the the VOB is not as clear.  During the playback the m2ts disk is so much better than the Adobe VOB format.
    Does anyone know if this is the best format that Adobe can produce?   It's a shame that with the great High Definition picture that you can now get out of a personal movie camera, that Adobe cannot produce the same quality picture out on disk!!

  • Software available for working with large video files?

    Hello,
    I'm working in PP CS6. I was wondering if there are any workarounds or 3rd party plugins/software that
    make working with really large video files easier and faster?
    Thanks.
    Mark

    Hi Jeff,
    Thanks for helping. This is the first time I shot video with my Nikon D5200. It was only a 3 minute test clip
    set at the highest resolution, 1920x1080-60i. I saw the red line above the clip in PP CS6 and hit the enter
    key to render the clip.
    It took almost 18 minutes or so to render the clip. This is probably normal but I was wondering if there is
    a way to reduce the file size so it doesn't take quite as long to render. I just remember a few years back
    that when the Red camera was out, guys were working with really huge files and there was a program
    from Cine something that they used to reduce the file size and make it more manageable when editing.
    I could be mistaken. I've been out of the editing look for a few years and just getting back into it.
    Thanks.
    Mark
    Here's my PC's components list you asked for:
    VisionDAW 4U 8-Core Xeon Workstation
      2 Intel QUAD-Core Xeon 5365-3.0GHz, 8MB, 1333MHz Processors
      16GB 667MHz Fully Buffered Server Memory Modules (2x2GB)
      Microsoft® Windows® Windows 7 Ultimate (x64)
      WDC 250GB, Ultra ATA100, 7200 rpm, 8MG Buffer Main OS HD
      2 WWDC 750GB, SATA II, 7200 RPM, 16MB Buffer HD (Raid 0)
      2 WDC 750GB, SATA II, 7200 rpm, 16MG Buffer HD (Samples)
      2 WDC 1TB Enterprise Class, SATA II, 7200 RPM, 32MB Buffer Hard Drive
      MOTU 24 I/O (main) / MOTU 2408mk3 (slave)
      Plexor PX-800A 18X Dbl. Layer DVD+/-RW Optical Drive
      Buffalo BuRay Drive (External) BR-816SU2 
      Front Panel USB Acess
      Integrated FireWire (1394a) interface
      Thermaltake Toughpower 850W Power Supply
      3xUAD1 Universal Audio Cards
      NVIDIA QUADRO FX 1800 / Memory 768 MB GDDR3
      CUDA Parallel Processor Cores / 64
      Maximum Display Resolution Digital @60Hz = 2560x1600
      Memory Interface 192Bit
      Memory Bandwidth (GB/sec) / 38.4 GB/sec
      PCI-Express, DUAL-Link DVI 1
      Digital Outputs 3 (2 out of 3 active at a time)
      Dual 25.5" Samsung 2693HM LCD HD Monitors

  • Speed up Illustrator CC when working with large vector files

    Raster (mainly) files up to 350 Mb. run fast in Illustrator CC, while vector files of 10 Mb. are a pain in the *blieb* (eg. zooming & panning). When reading the file it seems to freeze around 95 % for a few minutes. Memory usage goes up to 6 Gb. Processor usage 30 - 50 %.
    Are there ways to speed things up while working with large vector files in Illustrator CC?
    System:
    64 bit Windows 7 enterprise
    Memory: 16 Gb
    Processor: Intel Xeon 3,7 GHz (8 threads)
    Graphics: nVidia Geforce K4000

    Files with large amounts vector points will put a strain on the fastest of computers. But any type of speed increase we can get you can save you lots of time.
    Delete any unwanted stray points using  Select >> Object >> stray points
    Optimize performance | Windows
    Did you draw this yourself, is the file as clean as can be? Are there any repeated paths underneath your art which do not need to be there from live tracing or stock art sites?
    Check the control panel >> programs and features and sort by installed recently and uninstall anything suspicious.
    Sorry there will be no short or single answer to this, as per the previous poster using layers effectively, and working in outline mode when possible might the best you can do.

  • Working with converted .mov files in Premiere Elements 2

    I recently got a digital camera that records .mov clips with H.264 technology. I use it for back up when Im having problems with my regular camcorder. Of course I can work with these .mov files in QuickTime Pro with no problem. But in order to work with them in Premiere Elements 2, it appears I have to export it into the .avi format first. After exporting in QuickTime Pro, when I bring the new .avi file up into Premiere Elements, the color quality is retained, but much of the resolution is lost. Its very pixelated. I understand that .avi and .mov work differently in the way information is stored avi in chunks and mov in streams, but Im wondering if there is a way I can work around this. The reason why I got QuickTime Pro initially was to be able to convert my finished .avi videos made in Premiere Elements 2 into MPEG-4 files using the H.264 codec for better quality. And Im doing that all the time now with no problem. So I am wondering if when I reconvert the .mov clip thats been converted into .avi back into mpeg-4, will the resolution be restored? That is part of my question. The other part is regarding the initial conversion process. Are there settings in QuickTime Pro for converting .mov to .avi with as little loss in resolution as possible? The manual doesnt address this issue specifically. Any ideas or suggestions? OS is Windows XP Media Center edition, computer Sony Vaio dual processor. Thanks, Judy

    Hi again Steve. I'm so embarrassed. After my initial reply to your message I went to the Adobe site to see if they even made Premiere for Mac and learned they don't. I also read a review in Wired that says Premiere 6 is just as good if not better than iMovie which they say has actually been downgraded. I'm using Premiere 2, so I thought I might consider upgrading. Then I watched "Steve's Story" and realized it was you. (Your daughter is a cutie! Adobe must love you.) So my question is this: Would my problem be solved by simply upgrading to Premiere 4? If I do that, would it be compatible with regard to catalog integration with Photoshop Elements 4 or would I have to upgrade to Elements 6? If I upgraded the whole package would my current Photoshop Elements 4 catalog transfer with all tags intact? This is vital for me to know because I rely on them heavily. I realize that I would be skipping a version in the upgrade. Is that possible? Does that matter? Please read my reply to Bill because it explains why I want to use those particular .mov files. Another question for you. I use your excellent book a lot. If I upgrade will it become useless? Finally, since you're the expert, let me tell you what I'm really aiming for and get your advice. I need to start composing my own musical soundtracks to my videos. I want to do it as I'm viewing the timeline. Therefore, I know I need to invest in a midi-capable keyboard or controller and software. The problem is that there are few controllers compatible with Windows XP Media Center Edition. I am told I would need to disable the XP Media Center registry keys for anything to work which wouldn't matter because I don't use Media Center features anyway (like TV hookup, media player, etc.). But messing with the registry sounds a little complex and dangerous to me. There's got to be an easier way. Do you have any advice or recommendations? Can you point me to any helpful resources? Now you see why I want a Mac? Everyone says all this kind of stuff would be so much easier with a Mac. Problem is I have a limited budget and would like to make the most with what I have. I hope I haven't overtaxed you with my questions. Thanks for your patience! Judy

  • How to work with the remote file system

    Hi all,
    I want to know how we can work with the remote file sytem.
    Code should be some thing like
    File f = new File("//10.22.33.122/images")
    images is share name..
    i want the file names of all the images in that shared folder...
    Thanks in advance,
    Srinivas N

    try this one:
    File f = new File("//10.22.33.122/images")
    File[] files = f.listFiles(new FilenameFilter() {
         public boolean accept(File dir, String name)
    // Specify the extentions of files to be included.
         return name.endsWith(".bmp") || name.endsWith(".gif");
    // get names of the files
    String[] fileNamesArray = null;
    for (int indx = 0; indx < files.length(); indx++)
    fileNamesArray[indx] = files[indx].getName();
    return fileNamesArray;

  • Can I use InDesign cs6 to open and work with PM6.5 files?

    Can I use InDesign cs6 to open and work with PM6.5 files?

    Lrak wrote: "It sounds like I should to that before endeavoring to transfer the manuscript?" (re-link)
    It should be much easier to re-link in the Pagemaker file, as, with any luck, you can get the filenames from the Graphics Manager.  After conversion to InDesign, any out-of-date linked images get their names converted to something like "image 123.jpg", and are themselves converted to an embedded low res representation of the image.  Even vectored art.  Pretty hard to figure them out, unless you are VERY familiar with the file, which you may be.
    It may be that any cropping gets lost, too?  I do prepress work, we do some set up for our customers, but most comes in pretty much ready to go, so I don't often have to did too deep into fixing such issues. On the other hand, any problem that can happen has probably crossed my desk, or it seems that way some days!

  • I cant upgrade camera raw and need to to be able to work with new camera files  why?

    i cant upgrade camera raw and need to to be able to work with new camera files  why?

    Boilerplate text from Best Practices FAQ
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
        * Adobe product and version number
        * Operating system and version number
        * The full text of any error message(s)
        * What you were doing when the problem occurred
        * Screenshots of the problem
        * Computer hardware, such as CPU; GPU; amount of RAM; etc.

Maybe you are looking for

  • Constant pop up not letting me do anything??!

    Someone please help!! Just upgraded to Lion, and now I have a constant pop up that isnt letting me do anything! I have to keep clicking back onto this screen to write this! The pop up comes up with the finder face and says "You can't open the applica

  • Can i download ios 7 using iTunes 11.1 without USB concoction i mean only wifi and how

    thx for your time

  • RAIDS and Time Machine?

    I want to get a Mac Pro with 4 500 GB HDs. I want to stripe two of the HDs together, and then stripe the other 2 together giving me two RAID 0's of 1 Terabyte each. Then can I use Time Machine when it is released to backup the primary RAID to the sec

  • ERROR max no of cpic clients exceeded (2000)

    Hi all, We are the error max no. of CPIC clients exceeded (2000) when logging through ESS Portal Please help me to resolve this soon. Regards, Kalyan

  • I can't turn off voicemail divert

    I'm going abroad next week and I don;t want to get stung again with Vmail charges.  Yesterday and today I've tried sending VM off to 150 and dialing 150 and going through the menus.  Each time I get greated with "Sorry there's a problem." Will this g