1. string statement "SELECT TOP " maxRecords FROM Customers ";   
  2. string whereConcatenator "WHERE ";   
  3. if (companyNameTextBox.Text.Length 0)   
  4. {   
  5.  statement += whereConcatenator;   
  6.  statement += "CompanyName like "companyNameTextBox.Text "%";   
  7.  whereConcatenator "AND ";   
  8. }   
  9. if (cityTextBox.Text.Length 0)   
  10. {   
  11.  statement += whereConcatenator;   
  12.  statement += "City like "cityTextBox.Text "%";   
  13.  whereConcatenator "AND ";   
  14. }   
  15. if (countryComboBox.SelectedItem != null)   
  16. {   
  17.  statement += whereConcatenator;   
  18.  statement += "Country "countryComboBox.SelectedItem "";   
  19.  whereConcatenator "AND ";   
  20.   

相关文章:

  • 2021-05-21
  • 2022-12-23
  • 2021-06-07
  • 2022-01-06
  • 2022-12-23
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案