Answer the question
In order to leave comments, you need to log in
How to make an AutoComplete form in C#?
I have t.Text - 3 letters that are entered. DataTable dt = GetMusic(запрос);
- so I have an interaction with the base.
I need to make a query that will select all names (name - column) from the table that include t.Text and convert them to string[]. Already tried a lot of things. Please help me!
Answer the question
In order to leave comments, you need to log in
If you understand the condition correctly, then you can try something like this (the first thing that came to mind)
string query = String.Format("Select name From myTable Where name LIKE '{0}%'", t.Text);
DataTable dt = GetMusic(query);
var names = new string[dt.Rows.Count];
for (int index = 0; index < dt.Rows.Count; index++)
names[index] = dt.Rows[index][0].ToString();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question