SqlCeConnection sqlcon = new SqlCeConnection(@"Data Source = TranslationTest.sdf"); SqlCeCommand sqlcmd; SqlCeDataReader sqldr; AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection(); private void Form1_Load(object sender, EventArgs e) { try { sqlcon.Open(); sqlcmd = new SqlCeCommand("SELECT EnglishWord,ArabicWord FROM T1", sqlcon); sqldr = sqlcmd.ExecuteReader(); AutoCompleteStringCollection mycollection = new AutoCompleteStringCollection(); while (sqldr.Read()) { mycollection.Add(sqldr.GetString(0)); } textBox1.AutoCompleteCustomSource = mycollection; sqlcon.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
SqlCeConnection sqlcon = new SqlCeConnection(@"Data Source = TranslationTest.sdf;Password=778899;"); SqlCeCommand sqlcmd; SqlCeDataReader sqldr; AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection(); private void Form1_Load(object sender, EventArgs e) { try { sqlcon.Open(); sqlcmd = new SqlCeCommand("SELECT EnglishWord,ArabicWord FROM T1", sqlcon); sqldr = sqlcmd.ExecuteReader(); AutoCompleteStringCollection mycollection = new AutoCompleteStringCollection(); while (sqldr.Read()) { mycollection.Add(sqldr.GetString(0)); } textBox1.AutoCompleteCustomSource = mycollection; sqlcon.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)