how to create SELECT query with some conditions
There is a query

      string query=string.Format("SELECT * FROM table WHERE id='{0}' AND name='{1}'",textBox1.Text,textBox2.Text);

Example of work.

table

    1 xx
    2 yy
    3 xx
1)
    
    textbox1.Text=="";
    textbox2.Text=="";
result - 

    1 xx
    2 yy
    3 xx
2)

    textbox1.Text=="";
    textbox2.Text=="xx";
result - 

    1 xx
    3 xx
how to create SELECT query with some conditions
===

There is a query

      string query=string.Format("SELECT * FROM table WHERE id='{0}' AND name='{1}'",textBox1.Text,textBox2.Text);

Example of work.

table

    1 xx
    2 yy
    3 xx
1)
    
    textbox1.Text=="";
    textbox2.Text=="";
result - 

    1 xx
    2 yy
    3 xx
2)

    textbox1.Text=="";
    textbox2.Text=="xx";
result - 

    1 xx
    3 xx