Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public delegate DataTable loadDataTable();
  2.  
  3. DataTable shops = (cmbShop.Text == "All Shops") ?
  4. new loadDataTable(() =>
  5. {
  6. Program.con.GET_Table_From_DataBase("sh", "select * from shops ");
  7. return Program.con.dst.Tables["sh"];
  8. }
  9. ).Invoke()
  10. :
  11. new loadDataTable(() =>
  12. {
  13. Program.con.GET_Table_From_DataBase("sh", "select * from shops where shopname='" + cmbShop.Text + "' ");
  14. return Program.con.dst.Tables["sh"];
  15. }
  16. ).Invoke();
  17.  
  18. if (cmbShop.Text == "All Shops")
  19. Program.con.GET_Table_From_DataBase("sh", "select * from shops ");
  20. else
  21. Program.con.GET_Table_From_DataBase("sh", "select * from shops where shopname='" + cmbShop.Text + "' ");
  22.  
  23. DataTable shops = Program.con.dst.Tables["sh"];
  24.  
  25. Program.con.GET_Table_FromDataBase("sh", string.Format("select * from shops{0}",
  26. (cmbShop.Text == "All Shops") ? string.Empty : string.Format(" where shopname='"+cmbShop.Text+"'"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement