Some netizens in Insus. NET are asking questions. Let's look at his questions:
Netizens are thinking of a problem and are trying to solve this problem. Maybe the number of text boxes is still increasing in the future. if these judgments are not solved, these if statements will become more and more popular, more serious maintenance is becoming more and more complex.
Let's take a look at the following demo. Insus. NET executes three queries. When the first query is executed, the execution results of the three SQL statements are the same. For the second time, the condition of the second and third SQL statements is changed. When the second statement is executed again, the execution result of the second statement is the same as that of the third statement. The last time is the condition for changing the SQL statement of the third sentence, it will overwrite the corresponding result.
What is the problem? If a text box has a value passed in, it will be judged by the value. If the text box is not filled in, it seems to have skipped this condition.
You can refer to Insus. NET's blog on query and search:
Http://www.cnblogs.com/insus/archive/2011/03/30/1999759.html
Http://www.cnblogs.com/insus/archive/2011/03/30/1999795.html
Http://www.cnblogs.com/insus/archive/2013/04/06/3002054.html
Http://www.cnblogs.com/insus/archive/2010/06/17/1759672.html
Http://www.cnblogs.com/insus/articles/1360985.html
Therefore, you do not need to make any judgment on the front end. No matter whether there is a value or no value, you just need to pass in the SQL statement or stored procedure as a parameter.