Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int GetProjectCount()
- {
- int aRes = 0;
- try
- {
- OpenDB();
- const string CS01 = "select count(*)::integer from web_project";
- bool bTOk = !fDB.InTransaction;
- if (bTOk) { fDB.BeginWork(); }
- try
- {
- IfxCommand cmd = fDB.GetCommand(CS01);
- try
- {
- aRes = (int)cmd.ExecuteScalar();
- if (bTOk) { fDB.CommitWork(); }
- }
- finally
- {
- cmd.Dispose();
- }
- }
- catch
- {
- if (bTOk) { fDB.RollbackWork(); }
- throw;
- }
- }
- catch (Exception ex)
- {
- string sErr = "Fehler in GetProjectCount.\r\n" + ex.Message;
- CreateServiceFaultException(sErr);
- }
- finally
- {
- CloseDB();
- }
- return aRes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement