//creat auto complete Collection AutoCompleteStringCollection collection = new AutoCompleteStringCollection();//Connection String string connectionString="your connection string";//creating connection StringSqlConnection con = new SqlConnection(connectionString);//open the connectioncon.Open();//get the data from databaseSqlDataAdapter ad = new SqlDataAdapter("select sname from tbl_Student", con);DataTable dt = new DataTable();ad.Fill(dt);if(dt.Rows.Count>0){for (int i = 0; i < dt.Rows.Count; i++){ //add the student name into auto complete collection collection.Add(dt.Rows[i].ItemArray[0].ToString());}}//after adding the student names into auto complete collection bind the collection to textboxtextBox1.AutoCompleteMode = AutoCompleteMode.Suggest;textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;textBox1.AutoCompleteCustomSource = collection;