title: Adding array as a source to jQuery autocomplete
body: <p>I need to supply my autocomplete from a webservice who passes an array into the autocomplete source.</p>
  
  <p>Here is my webservice:</p>
  
  <pre><code>    public Filter[] getAutoComplete(string column)
      {
          List&lt;Filter&gt; list = new List&lt;Filter&gt;();
  
          DbAccess dbacc = new DbAccess();
  
            DataTable dt = dbacc.getColumnHeader(column);
  
            Filter _Filter = new Filter();
  
  
            if (column == "member_id")
            {
                foreach (DataRow row in dt.Rows)
                {
                    _Filter.memid = row["member_id"].ToString();
                }
            }
            else if (column == "lname")
            {
                foreach (DataRow row in dt.Rows)
                {
                    _Filter.memid = row["lname"].ToString();
                }
            }
            else if (column == "mname")
            {
                foreach (DataRow row in dt.Rows)
                {
                    _Filter.memid = row["mname"].ToString();
                }
            }
            else if (column == "fname")
            {
                foreach (DataRow row in dt.Rows)
                {
                    _Filter.memid = row["fname"].ToString();
                }
            }
  
          list.Add(_Filter);
  
          return list.ToArray();
      }
  </code></pre>
  
  <p>And here is my jquery ajax:</p>
  
  <p>$.ajax({</p>
  
  <pre><code>    url: "webservices/wbFilters.asmx/getAutoComplete",
      data: json,
      type: "POST",
      dataType: "json",
      contentType: "application/json; charset=utf-8",
      success: function (mydata) {
  
          $("#tags").autocomplete({
              source: mydata
          });
  
      }
  });
  </code></pre>
  
  <p>I can verify that my list array has a value. I just couldn't attach it to my autocomplete. I read that I can add a array as a source but I really can't get it to work. </p>
  
  <p>Can someone please explain what needs to be done to get this working?</p>