Hii
I have a application in c#.net windows application.
i have a column named quality in sql server database table.
Now i want to use it as my autocomplete source for one of my textbox.
How can i do this?
Please help me
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sitakanta PadhyPosted Sep 27, 2010, 4:09 AM
// Check for state of connction
if ((con.State == ConnectionState.Closed)) {
con.Open();
}
//Query to slect usernames from your database table
qrystr = "select distinct username from users";
da = new MySqlDataAdapter(qrystr, con);
da.Fill(ds, "users");
for (int i = 0; i <= ds.Tables("users").Rows.Count - 1; i++) {
UsernameTextBox.AutoCompleteCustomSource.Add(ds.Tables("users").Rows(i).Item(0));
}