Note that there are some explanatory texts on larger screens.

plurals
  1. POC# AutoComplete
    primarykey
    data
    text
    <p>I am trying to add an autocomplete feature to a textbox, the results are coming from a database. They come in the format of</p> <blockquote> <p>[001] Last, First Middle</p> </blockquote> <p>Currently you must type [001]... to get the entries to show. <strong>So the problem is that I want it to complete even if I type the firstname first</strong>. So if an entry was</p> <blockquote> <p>[001] Smith, John D</p> </blockquote> <p>if I started typing John then this entry should show up in the results for the auto complete.</p> <p>Currently the code looks something like</p> <pre><code>AutoCompleteStringCollection acsc = new AutoCompleteStringCollection(); txtBox1.AutoCompleteCustomSource = acsc; txtBox1.AutoCompleteMode = AutoCompleteMode.Suggest; txtBox1.AutoCompleteSource = AutoCompleteSource.CustomSource; .... if (results.Rows.Count &gt; 0) for (int i = 0; i &lt; results.Rows.Count &amp;&amp; i &lt; 10; i++) { row = results.Rows[i]; acsc.Add(row["Details"].ToString()); } } </code></pre> <p><em>results is a dataset containing the query results</em></p> <p><em>The query is a simple search query using the like statement. The correct results are returned if we do not use the autocomplete and just toss the results into an array.</em></p> <p>Any advice?</p> <p><strong>EDIT:</strong></p> <p>Here is the query that returns the results</p> <pre><code>SELECT Name from view_customers where Details LIKE '{0}' </code></pre> <p><em>With {0} being the placeholder for the searched string.</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload