Josip Pavic

Josip Pavic

  • NA
  • 20
  • 10.9k

Simple database query question

Nov 29 2011 10:08 AM
I designed a simple database in c# win form. Database has only one table in it(workers), with columns(name, adress, city...).
Then I drag my table(workers) to win form, and want to make query in textbox1.
What I want is to have textbox with label near him that say "search by city", and when I type the name of city and press enter all records with that city appear on my form.
Problem starts when I right click my table(workers) in data sources>edit dataset>add query>query builder.

Can you tell me the next step when I open the query builder.


I know the code for textbox. It goes something like this:
if (e.KeyCode == Keys.Enter)
{
this.personsTableAdapter.onlyCity(this.workersDataSet.persons, textBox1.Text);
}
 Thank you very much for your help.
Josip


Answers (2)