Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

new entry not shown in autocomplete text box

$
0
0
Dear All My problem is when program is run and i am insert some new entry in the database then new entry not show in autocomplete textbox.when i close the program and rerun the program its working fine. i m using this code. string connstr = @"Server=.\SQLEXPRESS ;Initial Catalog=RPSJDB;Integrated Security=True; Max Pool Size=100"; string query = "Select distinct txtCustomerName from EntryTable order by txtCustomerName asc"; SqlConnection conn = new SqlConnection(connstr); SqlCommand cmd = new SqlCommand(query, conn); conn.Open(); SqlDataReader dReader = cmd.ExecuteReader(); AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection(); string connstr = @"Server=.\SQLEXPRESS ;Initial Catalog=RPSJDB;Integrated Security=True; Max Pool Size=100"; string query = "Select distinct txtCustomerName from EntryTable order by txtCustomerName asc"; SqlConnection conn = new SqlConnection(connstr); SqlCommand cmd = new SqlCommand(query, conn); conn.Open(); SqlDataReader dReader = cmd.ExecuteReader(); AutoCompleteStringCollection namesCollection = new AutoCompleteStringCollection(); while (dReader.Read()) { namesCollection.Add(dReader["txtCustomerName"].ToString()); } dReader.Close(); txtCustomerName.AutoCompleteMode = AutoCompleteMode.Suggest; txtCustomerName.AutoCompleteSource = AutoCompleteSource.CustomSource; txtCustomerName.AutoCompleteCustomSource = namesCollection;

Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>