title: Convert string to json array in C#
body: <p>I am new to C#. I want to convert the two strings to single JSON array.<br>
  I tried the following:</p>
  
  <pre><code>var username = "username";
  var password = "XXXXXXXX";
  var json_data = "result":[{"username":username,"password":password}]'; //To convert the string to Json array i tried like this
  MessageBox.Show(json_data);
  </code></pre>
  
  <p>It is not working, I'm getting a lot of errors.</p>
  
  <p>I've went through the following links:</p>
  
  <p><a href="http://json.codeplex.com/" rel="nofollow noreferrer">http://json.codeplex.com/</a></p>
  
  <p><a href="https://stackoverflow.com/questions/14935677/convert-string-to-json-array">Convert string to Json Array</a></p>
  
  <p><a href="http://www.codeproject.com/Articles/272335/JSON-Serialization-and-Deserialization-in-ASP-NET" rel="nofollow noreferrer">http://www.codeproject.com/Articles/272335/JSON-Serialization-and-Deserialization-in-ASP-NET</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6884453/convert-string-to-json">convert string to json</a></p>
  
  <p>To learn how to convert my string to Json array. Well explained in the above url, but for my case I don't know how to convert this two string to single Json array. </p>
  
  <p>I want the output to be like this format,</p>
  
  <pre><code>[{"result":{"username":"Tom","password":"XXXXXXX"}}]
  </code></pre>
  
  <p>Please help me in doing this.</p>