using (OleDbConnection con = new OleDbConnection(ConString)) { OleDbCommand cmd = new OleDbCommand("Select ConsigneeName From tblConsignee", con); OleDbDataReader dReader; SqlConnection conn = new SqlConnection(); con.ConnectionString = ConString; con.Open(); dReader = cmd.ExecuteReader(); if (dReader.HasRows == true) { while (dReader.Read()) namesCollection.Add(dReader["ConsigneeName"].ToString()); } else { } dReader.Close(); txtConsigneeName.AutoCompleteCustomSource = namesCollection; txtConsigneeName.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtConsigneeName.AutoCompleteSource = AutoCompleteSource.CustomSource; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)