TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Angel Princess
NA
100
47.6k
Autosearch textbox
Mar 14 2014 2:39 AM
My Code is:
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
AutoCompleteStringCollection col = new AutoCompleteStringCollection();
sqlconn.Open();
string query = "select id from cmp_det where id =" + textBox1.Text;
SqlCommand command = new SqlCommand(query, sqlconn);
SqlDataReader sdr = command.ExecuteReader();
while (sdr.Read())
{
col.Add(sdr["Column_Name"].ToString());
}
sdr.Close();
textBox1.AutoCompleteCustomSource = col;
sqlconn.Close();
Sometime it works correctly but sometime it gives error of "memory corrupt" in program.cs file when execute. also sometime it stops working with the error "Specified cast is not valid." Help me to solve these errors.
Reply
Answers (
7
)
Static Constructor
how to assign the user defined(downloaded) font in asp.net