CODE
SqlCommand cmd = new SqlCommand("select billno from tpdetail", con);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
AutoCompleteStringCollection MyCollection = new AutoCompleteStringCollection();
while (reader.Read())
{
MyCollection.Add(reader.GetString(0).ToString());
}
textBox3.AutoCompleteCustomSource = MyCollection;
I get the following exception:
Unable to cast object of type 'System.Int32' to type 'System.String'