title: How to assign JSON elements to a 2D array while in a Loop
body: <p>I'm trying to assign two items (user ID, amount) at the same level in a JSON object into a 2D array for each user ID in the JSON object (assume this object has 10 user IDs so 2D array should have 10 rows with User ID as column 0 and Amount as column 1):</p>
  
  <pre><code>JSON
      {"page":"1",
       "per_page":10,
       "total":100,
       "total_pages":10,
       "data":[{"id":1,
                "userId":1,
                "userName":"Jim Silver", 
                "timestamp":16425382171,
                "txnType":"debit",
                "amount":"$1,000.07",
                "location":{"id":2,
                            "address":"654, Somewhere, Some Street", 
                            "city":"Some City",
                            "zipCode":12345},
                            "ip":"202.210.105.105"},
            {"id":2," ...}
  </code></pre>
  
  <p>The result should be (amount converted to integer and Math.Floor applied):</p>
  
  <pre><code>[1, 1000] // User ID = 1, corresponding amount = 1000
  [2, 2000] // User ID = 2, ...
  [3, 3000]
  [4, 4000]
  ...
  </code></pre>
  
  <p>I modeled my JSON with three classes depicting the three levels in the JSON object.</p>
  
  <p>I've declared a 2D array:
  <code>int[,] userTxnsArr = new int[1, model.data.Count];</code> (10 rows, 2 columns)</p>
  
  <p>Now loop through the deserialized JSON object in model:</p>
  
  <pre><code>for (int datum = 0; datum &lt; model.data.Count; datum++)
  {
      userID = model.data[datum].id;
      userAmount = Convert.ToInt32(Math.Floor(decimal.Parse(model.data[datum].amount, System.Globalization.NumberStyles.Currency)));
      userTxnsArr = new int[,] { { userID, userAmount } };
  }
  </code></pre>
  
  <p>But I'm only getting the last JSON record in the 2D array (so only one row of data). How do I assign each JSON record into each row of the 2D array? Thanks in advance. </p>