1. Create a new Windows Application Project
  2. Add a reference to the REDotNetAPI.DLL  (Note: You can also access The Raiser's Edge API by referencing Blackbaud.PIA.RE7.BBREAPI.dll instead)
  3. Add a button to the form
  4. View the Code
  5. Add using REDotNetAPI; to the top of the code (This may be different depending on what you named your .dll)
  6. Paste the following code into the Button1_Click Event:

    REAPI oRE7 = new REAPI();

    //initialize with amServermode to avoid
    //splash screen and login prompt.  If you want to use amStandalone
    //mode with the login prompt then you must call the win32 OleInitialize api first.

    oRE7.Init ("WRE11111","Supervisor","admin",50,"",AppMode.amServer);

    //get a reference to the sessioncontext
    IBBSessionContext sc = oRE7.SessionContext;

    CRecord oRec = new CRecordClass();
    oRec.Init(ref sc);

    string sLastName=oRec.get_Fields(ERECORDSFields.RECORDS_fld_LAST_NAME).ToString();



    //Explicitly closedown the session context.
    //This is not strictly required, but if you don't do this
    //then the sessioncontext will remain connected until a garbage
    //collection occurs

    IBBDisposable disposer = (IBBDisposable)oRE7;


Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Blackbaud Customer Support may help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality.