Hi,

 

I am using FirebirdSql.Data.FirebirdClient for Compact Framework.

 

Below is my update function and the database procedure in question.

 

When the EXCEPTION RECORD_CHANGED is thrown in the database the FbException
is raised and caught in code but the associated message is not in the
FBException.

 

Could someone help me in retrieving the message associated with the
exception?

 

Thanks

Gary

 

       

 

      public void FbUpdate()

        {

            using (FbConnection cn = new
FbConnection(Database.DbConnection))

            {

                cn.Open();

                using (FbTransaction tr = cn.BeginTransaction())

                {

                    try

                    {

 

                        _DataAdapter.UpdateCommand.Connection = cn;

                        _DataAdapter.UpdateCommand.Transaction = tr;

 

                        _DataAdapter.Update(dtPURCHASEORDERSH);

 

                        tr.Commit();

                    }

                    catch (FbException FbEx)

                    {

                        tr.Rollback();

                        throw new System.Exception(FbEx.Message);

 

 

                    }

                }

            }

 

        }

 

CREATE PROCEDURE ISPURCHASEORDER_UPD (

....

 

  ROWVER Integer)

 returns (

  NEWROWVER Integer)

AS

begin

  UPDATE PURCHASEORDERSH SET

 

....

  

WHERE

  PURCHASEORDERHID = :PURCHASEORDERHID

  AND ROWVER = :ROWVER;

  

IF(ROW_COUNT = 0) THEN

  EXCEPTION RECORD_CHANGED;

      

......

 

end

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to