title: how to get a value from a datatable in webservice to a HTML ajax call
body: <p>I have a datatable in my web service it goes like this </p>
  
  <pre><code> [WebMethod]
          [ScriptMethod]
          public DataTable mydbCon()
              {
  SqlConnection SqlCon = new SqlConnection(@"Data Source=myds;Initial Catalog=name;Persist Security Info=True;User ID=sa;Password=pwd");
                  SqlCon.Open();
                  SqlCommand SqlComm = new SqlCommand();
                  SqlComm.Connection = SqlCon;
                  SqlComm.CommandType = CommandType.Text;
                  SqlComm.CommandText = "select password from tbl_login where username='aby';";
                  DataTable EmployeeDt = new DataTable("tbl_login");
                  SqlDataAdapter SqlDa = new SqlDataAdapter(SqlComm);
                  SqlDa.Fill(EmployeeDt);
                  return EmployeeDt;
              }
  </code></pre>
  
  <p>and I am having a Ajax call in my HTML page it goes like this and I am not getting a value it shows the error message</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
         function GetAge() {
             jQuery.support.cors = true;
             $.ajax({
                 type: "POST",
                 contentType: "application/json; charset=utf-8",
                 dataType: "json",
                 jsonp: 'jsonp_callback',
                 async: false,
                 url: "http://localhost:50113/Service1.asmx/mydbCon",
                 data: "{}",
                 success: function (msg) {
                      $('#divToBeWorkedOn').html(msg.d);
                  },
                 error: function (e) {
                     $('#divToBeWorkedOn').html("unavailable");
                 }
             });
         }
        &lt;/script&gt; 
  </code></pre>