Advertisement
Guest User

Untitled

a guest
Aug 16th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. public int GetProjectCount()
  2. {
  3. int aRes = 0;
  4. try
  5. {
  6. OpenDB();
  7.  
  8. const string CS01 = "select count(*)::integer from web_project";
  9.  
  10. bool bTOk = !fDB.InTransaction;
  11. if (bTOk) { fDB.BeginWork(); }
  12. try
  13. {
  14. IfxCommand cmd = fDB.GetCommand(CS01);
  15. try
  16. {
  17. aRes = (int)cmd.ExecuteScalar();
  18.  
  19. if (bTOk) { fDB.CommitWork(); }
  20. }
  21. finally
  22. {
  23. cmd.Dispose();
  24. }
  25. }
  26. catch
  27. {
  28. if (bTOk) { fDB.RollbackWork(); }
  29. throw;
  30. }
  31. }
  32. catch (Exception ex)
  33. {
  34. string sErr = "Fehler in GetProjectCount.\r\n" + ex.Message;
  35. CreateServiceFaultException(sErr);
  36. }
  37. finally
  38. {
  39. CloseDB();
  40. }
  41. return aRes;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement