public void TextAuto() { objHrInfo = new HRInfo(); DataTable dt = objHrInfo.GetNameandEcode().Tables[0]; objHrInfo = null; AutoCompleteStringCollection local = new AutoCompleteStringCollection(); for (int i = 0; i < dt.Rows.Count; i++) { local.Add(dt.Rows[i]["Data"].ToString()); } txtReportto.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtReportto.AutoCompleteSource = AutoCompleteSource.CustomSource; txtReportto.AutoCompleteCustomSource = local; }