string myQuery = "SELECT * FROM MyTable WHERE column1 = '" + textbox1.Text + " AND column2 = '" + textbox2.Text + "' AND column3 = '" + textbox3.Text + "'"; That is not very good but a good start for the student who wants someone else to do his homework.