title: Create JSON Object in Web Service C#
body: <p>Im beginner for Web Service in C# to result data JSON.
  So, I have Web service to throw data with format JSON, 
  this is my result JSON :</p>
  
  <pre><code>[{"RESULT":"2","TKN":"E952B4C5FA9","URL_HOME":"My_Url_Home"}]
  </code></pre>
  
  <p>How to remove Symbol "[" and "]" in My Result Json, So I want My Result JSON become this :</p>
  
  <pre><code>{"RESULT":"2","TKN":"E952B4C5FA9","URL_HOME":"My_Url_Home"}
  </code></pre>
  
  <p>And this is My Code :</p>
  
  <pre><code>    [WebMethod]
      [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
      public void Create_JSON()
      {
          SqlConnection con = new SqlConnection(consString);
          SqlCommand cmd = new SqlCommand();
  
          DataTable dt;
          SqlDataReader reader;
  
          HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
  
          if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
          {
              //These headers are handling the "pre-flight" OPTIONS call sent by the browser
              HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
              HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept");
              HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
              HttpContext.Current.Response.End();
          }
          String resultJSON = "";
          JavaScriptSerializer js = new JavaScriptSerializer();
          try
          {
              Context.Response.Clear();
              Context.Response.ContentType = "application/json";
  
              cmd.CommandType = CommandType.StoredProcedure;
              cmd.CommandText = "My_Store_Procedure";
              cmd.Connection = con;
  
              con.Open();
              reader = cmd.ExecuteReader();
              dt = new DataTable();
              dt.Load(reader);
              con.Close();
  
  
              JavaScriptSerializer serializer = new JavaScriptSerializer();
              List&lt;Dictionary&lt;String, Object&gt;&gt; tableRows = new List&lt;Dictionary&lt;string, object&gt;&gt;();
              Dictionary&lt;String, Object&gt; row;
  
              foreach (DataRow dr in dt.Rows)
              {
                  row = new Dictionary&lt;string, object&gt;();
                  foreach (DataColumn col in dt.Columns)
                  {
                      row.Add(col.ColumnName, dr[col].ToString());
                  }
                  tableRows.Add(row);
              }
              resultJSON = serializer.Serialize(tableRows).ToString();
  
          }
          catch (Exception ex)
          {
              resultJSON = ex.Message.ToString();
          }
          Context.Response.Write(resultJSON);
      }
  </code></pre>
  
  <p>;</p>
  
  <p>Please Help, and Thanks For All Answer.</p>