<PAGE>   1
                          DENDRITE INTERNATIONAL, INC.
                           DEFERRED COMPENSATION PLAN
                                TRUST AGREEMENT


     This Agreement is made this 21st day of July, 1998, by and between Dendrite
International, Inc. (the "Company") and First American Trust Company (the
"Trustee").

     WHEREAS, the Company has adopted the Dendrite International, Inc. Deferred 
Compensation Plan; and

     WHEREAS, the Company will incur liability under the terms of such Plan 
with respect to the individuals participating in such Plan; and

     WHEREAS, the Company wishes to establish a trust (the "Trust") and to 
contribute to the Trust assets that shall be held therein, subject to the 
claims of the Company's creditors in the event of the Company's Insolvency, as 
herein defined, until paid to Plan participants and their beneficiaries in such 
manner and at such times as specified in the Plan; and

     WHEREAS, it is the intention of the parties that this Trust shall 
constitute an unfunded arrangement and shall not affect the status of the Plan 
as an unfunded plan maintained for the purpose of providing deferred 
compensation for a select group of management or highly compensated employees 
for purposes of Title I of the Employee Retirement Income Security Act of 
1974;  and

     WHEREAS, it is the intention of the Company to make contributions to the 
Trust to provide itself with a source of funds to assist it in the meeting of 
its liabilities under the Plan;

     NOW, THEREFORE, the parties do hereby establish the Trust and agree that 
the Trust shall be comprised, held and disposed of as follows:

     SECTION 1. ESTABLISHMENT OF TRUST

     (a) The Company hereby deposits with the Trustee in trust certain assets, 
which, together with future contributions and earnings, shall become the 
principal of the Trust to be held, administered and disposed of by the Trustee 
as provided in this Trust Agreement.

     (b) The Trust hereby established shall be irrevocable.

     (c) The Trust is intended to be a grantor trust, of which the Company is
the grantor, within the meaning of subpart E, part I, subchapter J, chapter 1,
subtitle A of the Internal Revenue Code of 1986, as amended, and shall be
construed accordingly.
<PAGE>   2
     (d) The principal of the Trust, and any earnings thereon shall be held 
separate and apart from other funds of the Company and shall be used 
exclusively for the uses and purposes of Plan participants and general 
creditors as herein set forth. Plan participants and their beneficiaries shall 
have no preferred claim on, or any beneficial ownership interest in, any assets 
of the Trust. Any rights created under the Plan and this Trust Agreement shall 
be mere unsecured contractual rights of Plan participants and their 
beneficiaries against the Company. Any assets held by the Trust will be subject 
to the claims of the Company's general creditors under federal and state law in 
the event of Insolvency, as defined in Section 3(a) herein.

     (e) The Company, in its sole discretion, may at any time, or from time to 
time, make additional deposits of cash or other property in trust with the 
Trustee to augment the principal to be held, administered and disposed of by 
the Trustee as provided in this Trust Agreement. Neither the Trustee nor any 
Plan participant or beneficiary shall have any right to compel such additional 
deposits.

     SECTION 2. PAYMENTS TO PLAN PARTICIPANTS AND THEIR BENEFICIARIES

     (a) The Company shall deliver to the Trustee a schedule (the "Payment 
Schedule") that indicates the amounts payable in respect of each Plan 
participant (and his or her beneficiaries), that provides a formula or other 
instructions acceptable to the Trustee for determining the amounts so payable, 
the form in which such amount is to be paid (as provided for or available under 
the Plan), and the time of commencement for payment of such amounts. Except as 
otherwise provided herein, the Trustee shall make payments to the Plan 
participants and their beneficiaries in accordance with such Payment Schedule. 
The Trustee shall make provision for the reporting and withholding of any 
federal, state or local taxes that may be required to be withheld with respect 
to the payment of benefits pursuant to the terms of the Plan and shall pay 
amounts withheld to the appropriate taxing authorities or determine that such 
amounts have been reported, withheld and paid by the Company.

     (b) The entitlement of a Plan participant or his or her beneficiaries to 
benefits under the Plan shall be determined by the Company or such party as it 
shall designate under the Plan, and any claim for such benefits shall be 
considered and reviewed under the procedures set out in the Plan.

     (c) The Company may make payment of benefits directly to Plan participants 
or their beneficiaries as they become due under the terms of the Plan. The 
Company shall notify the Trustee of its decision to make payment of benefits 
directly prior to the time amounts are payable to participants or their 
beneficiaries. In addition, if the principal of the Trust, and any earnings 
thereon, are not sufficient to make payments of benefits in accordance with the 
terms of the Plan, the Company shall make the balance of each such payment as 
it falls due. The Trustee shall notify the Company where principal and earnings 
are not sufficient.


                                       2
<PAGE>   3
     SECTION 3. TRUSTEE RESPONSIBILITY REGARDING PAYMENTS TO TRUST 
BENEFICIARIES WHEN THE COMPANY IS INSOLVENT

     (a) The Trustee shall cease payment of benefits to Plan participants and 
their beneficiaries if the Company is Insolvent. The Company shall be 
considered "Insolvent" for purposes of this Trust Agreement if (i) the Company 
is unable to pay its debts as they become due, or (ii) the Company is subject 
to a pending proceeding as a debtor under the United States Bankruptcy Code.

     (b) At all times during the continuance of this Trust, as provided in 
Section 1(d) hereof, the principal and income of the Trust shall be subject to 
claims of general creditors of the Company under federal and state law as set 
forth below.

         (1) The Board of Directors and the Chief Executive Officer of the
     Company shall have the duty to inform the Trustee in writing of the
     Company's Insolvency. If a person claiming to be a creditor of the Company
     alleges in writing to the Trustee that the Company has become Insolvent,
     the Trustee shall determine whether the Company is Insolvent and, pending
     such determination, the Trustee shall discontinue payment of benefits to
     Plan participants or their beneficiaries.

         (2) Unless the Trustee has actual knowledge of the Company's
     Insolvency, or has received notice from the Company or a person claiming to
     be a creditor alleging that the Company is Insolvent, the Trustee shall
     have no duty to inquire whether the Company is Insolvent. The Trustee may
     in all events rely on such evidence concerning the Company's solvency as
     may be furnished to the Trustee and that provides the Trustee with a
     reasonable basis for making a determination concerning the Company's
     solvency.

         (3) If at any time the Trustee has determined that the Company is
     Insolvent, the Trustee shall discontinue payments to Plan participants or
     their beneficiaries and shall hold the assets of the Trust for the benefit
     of the Company's general creditors. Nothing in this Trust Agreement shall
     in any way diminish any rights of Plan participants or their beneficiaries
     to pursue their rights as general creditors of the Company with respect to
     benefits due under the Plan or otherwise.

         (4) The Trustee shall resume the payment of benefits to Plan
     participants or their beneficiaries in accordance with Section 2 of this
     Trust Agreement only after the Trustee has determined that the Company is
     not Insolvent (or is no longer Insolvent).

     (c) Provided that there are sufficient assets, if the Trustee discontinues 
the payment of benefits from the Trust pursuant to Section 3(b) hereof and 
subsequently resumes such payments, the first payment following such 
discontinuance shall include the aggregate amount of all payments due to Plan 
participants or their beneficiaries under the


                                       3
<PAGE>   4
terms of the Plan for the period of such discontinuance, less the aggregate 
amount of any payments made to Plan participants or their beneficiaries by the 
Company in lieu of the payments provided for hereunder during any such period 
of discontinuance.


SECTION 4. PAYMENTS TO THE COMPANY

     Except as provided in Section 3 hereof, the Company shall have no right or
power to direct the Trustee to return to the Company or to divert to others any
of the Trust assets before all payment of benefits have been made to Plan
participants and their beneficiaries pursuant to the terms of the Plan.

SECTION 5. INVESTMENT AUTHORITY

     The Trustee may invest in securities (including stock or rights to acquire
stock) or obligations issued by the Company. All rights associated with assets
of the Trust shall be exercised by the Trustee or the person designated by the
Trustee, and shall in no event be exercisable by or rest with Plan participants.

     The Company shall have the right at anytime, and from time to time in its
sole discretion, to substitute assets of equal fair market value for any asset
held by the Trust. This right is exercisable by the Company in a nonfiduciary
capacity without the approval or consent of any person in a fiduciary capacity.

SECTION 6. DISPOSITION OF INCOME

     During the term of this Trust, all income received by the Trust, net of 
expenses and taxes, shall be accumulated and reinvested.

SECTION 7. ACCOUNTING BY THE TRUSTEE

     The Trustee shall keep accurate and detailed records of all investments,
receipts, disbursements, and all other transactions required to be made,
including such specific records as shall be agreed upon in writing between the
Company and the Trustee. Within 30 days following the close of each calendar
year and within 30 days after the removal or resignation of the Trustee, the
Trustee shall deliver to the Company a written account of its administration of
the Trust during such year or during the period from the close of the last
preceding year to the date of such removal or resignation, setting forth all
investments, receipts, disbursements and other transactions effected by it,
including a description of all securities and investments purchased and sold
with the cost or net proceeds of such purchases or sales (accrued interest paid
or receivable being shown separately), and showing all cash, securities and
other property held in the Trust at the end of such year or as of the date of
such removal or resignation, as the case may be.


                                       4
<PAGE>   5
     SECTION 8. RESPONSIBILITY OF THE TRUSTEE

     (a)  The Trustee shall act with the care, skill, prudence and diligence 
under the circumstances then prevailing that a prudent person acting in like 
capacity and familiar with such matters would use in the conduct of an 
enterprise of a like character and with like aims, provided, however, that the 
Trustee shall incur no liability to any person for any action taken pursuant 
to a direction, request or approval given by the Company which is contemplated 
by, and in conformity with, the terms of the Plan or this Trust and is given in 
writing by the Company. In the event of a dispute between the Company and a 
party, the Trustee may apply to a court of competent jurisdiction to resolve 
the dispute.

     (b)  If the Trustee undertakes or defends any litigation arising in 
connection with this Trust, the Company agrees to indemnify the Trustee against 
the Trustee's costs, expenses and liabilities (including, without limitation, 
attorneys' fees and expenses) relating thereto and to be primarily liable for 
such payments. If the Company does not pay such costs, expenses and liabilities 
in a reasonably timely manner, the Trustee may obtain payment from the Trust.

     (c)  The Trustee may consult with legal counsel (who may also be counsel 
for the Company generally) with respect to any of its duties or obligations 
hereunder.

     (d)  The Trustee may hire agents, accountants, actuaries, investment 
advisors, financial consultants or other professionals to assist it in 
performing any of its duties or obligations hereunder.

     (e)  The Trustee shall have, without exclusion, all powers conferred on 
trustees by applicable law, unless expressly provided otherwise herein, 
provided, however, that if an insurance policy is held as an asset of the Trust,
the Trustee shall have no power to name a beneficiary of the policy other than
the Trust, to assign the policy (as distinct from conversion of the policy to a
different form) other than to a successor Trustee, or to loan to any person the
proceeds of any borrowing against such policy.

     (f)  Notwithstanding any powers granted to the Trustee pursuant to this 
Trust Agreement or to applicable law, the Trustee shall not have any power that 
could give this Trust the objective of carrying on a business and dividing the 
gains therefrom, within the meaning of section 301.7701-2 of the Procedure and 
Administrative Regulations promulgated pursuant to the Internal Revenue Code.

     SECTION 9. COMPENSATION AND EXPENSES OF THE TRUSTEE

     The Company shall pay all administrative and the Trustee's fees and 
expenses. If not so paid, the fees and expenses shall be paid from the Trust.

                                       5
<PAGE>   6
     SECTION 10. RESIGNATION AND REMOVAL OF THE TRUSTEE

     (a)  The Trustee may resign at any time by written notice to the Company, 
which shall be effective 30 days after receipt of such notice unless the 
Company and the Trustee agree otherwise.

     (b)  The Trustee may be removed by the Company without advance notice.

     (c)  Upon resignation or removal of the Trustee and appointment of a 
successor Trustee, all assets shall subsequently be transferred to the 
successor Trustee. The transfer shall be completed within 7 days after receipt 
of notice of resignation, removal or transfer, unless the Company extends the 
time limit. 

     (d)  If the Trustee resigns or is removed, a successor shall be 
appointed, in accordance with Section 11 hereof, by the effective date of 
resignation or removal under paragraphs (a) and (b) of this section. If no such
appointment has been made, the Trustee may apply to a court of competent 
jurisdiction for appointment of a successor or for instructions. All expenses 
of the Trustee in connection with the proceeding shall be allowed as 
administrative expenses of the Trust.

     SECTION 11. APPOINTMENT OF SUCCESSOR

     (a)  If the Trustee resigns or is removed in accordance with Section 
10(a) or (b) hereof, the Company may appoint any third party, such as a bank 
trust department or other party that may be granted corporate the Trustee 
powers under state law, as a successor to replace the Trustee upon resignation 
or removal. The appointment shall be effective when accepted in writing by the 
new Trustee, who shall have all of the rights and powers of the former Trustee, 
including ownership rights in the Trust assets. The former Trustee shall 
execute any instrument necessary or reasonably requested by the Company or the 
successor Trustee to evidence the transfer.

     (b)  The successor Trustee need not examine the records and acts of any 
prior Trustee and may retain or dispose of existing Trust assets, subject to 
Sections 7 and 8 hereof. The successor Trustee shall not be responsible for, 
and the Company shall indemnify and defend the successor Trustee from, any claim
or liability resulting from any action or inaction of any prior Trustee or from
any other past event, or any condition existing at the time it becomes successor
Trustee.

     SECTION 12. AMENDMENT OR TERMINATION

     (a)  This Trust Agreement may be amended by a written instrument executed 
by the Trustee and the Company. Notwithstanding the foregoing, no such 
amendment shall conflict with the terms of the Plan or shall make the Trust 
revocable.

     (b)  The Trust shall not terminate until the date on which Plan 
participants and their beneficiaries are no longer entitled to benefits 
pursuant to the terms of the Plan.


                                       6
<PAGE>   7
Upon termination of the Trust any assets remaining in the Trust shall be 
returned to the Company.

     (c)  Upon written approval of participants or beneficiaries entitled to 
payment of benefits pursuant to the terms of the Plan, the Company may 
terminate this Trust prior to the time all benefit payments under the Plan have 
been made. All assets in the Trust at termination shall be returned to the 
Company.

     SECTION 13. MISCELLANEOUS

     (a)  Any provision of this Trust Agreement prohibited by law shall be 
ineffective to the extent of any such prohibition, without invalidating the 
remaining provisions hereof.

     (b)  Benefits payable to Plan participants and their beneficiaries under 
this Trust Agreement may not be anticipated, assigned (either at law or in 
equity), alienated, pledged, encumbered or subjected to attachment, 
garnishment, levy, execution or other legal or equitable process.

     (c)  This Trust Agreement shall be governed by and construed in accordance 
with the laws of New Jersey, except to the extent that federal law controls.

     SECTION 14. EFFECTIVE DATE

     The effective date of this Trust Agreement shall be September 1, 1998.

                                        DENDRITE INTERNATIONAL, INC.,
                                        AS GRANTOR
                              
                                         /s/ Christopher J. French
                                        ---------------------------------------
                                        By:  Christopher J. French
                                             Vice President, General Counsel



                                        FIRST AMERICAN TRUST COMPANY,
                                        AS TRUSTEE
 
                                         /s/ Denise C. Mehus      
                                        ---------------------------------------
                                        By:  Denise C. Mehus
                                             Vice President



                                       7