private void search_vuncher()
{
SqlConnection con = new SqlConnection(dbclass.constring);
try
{
string query = "SELECT Vuncher from tbl_customer";
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
AutoCompleteStringCollection Mycollection = new AutoCompleteStringCollection();
while (reader.Read())
{
Mycollection.Add(reader.GetString(0));
}
txt_vuncher.AutoCompleteCustomSource = Mycollection;
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
}
}