title: Autocomplete combobox with drop list property
body: <p>I am trying to implement an auto-complete combo box in C#.I could do this when i set the combo box drop down property to 'drop down'.But couldn't get the result when drop down property is set to 'Drop list'. Please help me to solve this.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>var connection=new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\xxx.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
              var command=new SqlCommand("SELECT model FROM vehicle",connection);
              var adapter=new SqlDataAdapter(command);
              var ds = new DataSet();
              adapter.Fill(ds);
              AutoCompleteStringCollection col = new AutoCompleteStringCollection();
              int i = 0;
              for (i = 0; i &lt;= ds.Tables[0].Rows.Count - 1; i++)
              {
                  col.Add(ds.Tables[0].Rows[i]["model"].ToString());
              }
              comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
              comboBox1.AutoCompleteCustomSource = col;
              comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;  
  </code></pre>