zoukankan      html  css  js  c++  java
  • 黄聪:在C#中建立复杂的、灵活的SQL查询/命令

    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.   

  • 相关阅读:
    POJ3297+map字符串处理
    POJ3204+DInic+maxflow
    HDU4704+费马小定理
    FZU-1924+判断环/DFS/BFS
    FZU-1921+线段树
    FZU-1926+KMP
    CodeForce 339:A+B+C
    HDU2896+AC自动机
    POJ2527+多项式除法
    鼠标移入移出事件
  • 原文地址:https://www.cnblogs.com/huangcong/p/1697070.html
Copyright © 2011-2022 走看看