title: How to convert a MySQL query to JSON on C#
body: <p>Here's my code</p>
  
  <p>I want to know how can i show the follow query on JSON format in C# touse it in a Web Service</p>
  
  <pre><code>    public void GetEmpleadoJSON()
      {
          string server = "localhost", database = "ventas", user = "root", pass = "";
          MySqlConnection conectar = new MySqlConnection("server=" + server + "; database=" + database + "; Uid=" + user + "; pwd=" + pass + ";");
          conectar.Open();
          MySqlCommand command = conectar.CreateCommand();
  
          //consulta select
          command.CommandText = ("SELECT `nombre` FROM `cliente` WHERE id_cliente=901 ");
          command.Connection = conectar;
          MySqlDataReader reader = command.ExecuteReader();
  
  
          Empleado[] emps = new Empleado[] {
          new Empleado(){
              Id=101,
              Name=reader.ToString(),
              Salary=10000
          }
  
      };
         JavaScriptSerializer js = new JavaScriptSerializer();
         Context.Response.Write(js.Serialize(emps));
      }
  
  
  }
  </code></pre>
  
  <p>}</p>