Welcome to Forums Sign in | Join | Help | Forums
in Search


C#

Last post 08-02-2006 12:15 AM by Chris Thomson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-20-2006 7:47 AM

    I am trying to use the API in Visual Studio 2003 with C#. I am a C# novice programmer, and have come up against a brick wall as Blackbaud wont support C#. I am trying to create a new constituent and am using the set_Fields method. However, it requires another parameter - an object _MIDL_1725 - code below. cRec.set_Fields(ERECORDSFields.RECORDS_fld_FIRST_NAME) = dObj.firstName; Can someone please let me know what this is all about as I have never come across this before. Thanks for your help. Amit
  • 04-24-2006 9:29 AM In reply to

    • Jeff Kesinger
    • Not Ranked
    • Posts 1
    • Organization: Students in Free Enterprise - SIFE
    There is a couple of issues here. The first is that C# doesn't support optional parameters. You have to pass in null or Type.Missing in .Net 2.0. You will find that this won't work for the REAPI because of problem number 2. The second thing is that most of the parameters are interfaces and not classes. You can't create a null interface and you can't send in the class because the API expects an interface. Catch 22. I had to switch to VB.Net for any of the UI. Jeff
  • 08-02-2006 12:15 AM In reply to

    • Chris Thomson
    • Top 500 Contributor
    • Posts 37
    • Organization: Victoria University of Wellington
    • Products:  The Raiser's Edge
    Heres a bit of code that I have used for creating a constituent using C# CRecord record = new CRecordClass(); record.Init(ref sessionContext); record.set_Fields(ERECORDSFields.RECORDS_fld_LAST_NAME, _surame); record.set_Fields(ERECORDSFields.RECORDS_fld_IS_CONSTITUENT,"True"); record.Save(); record.CloseDown(); and it works fine.
Page 1 of 1 (3 items)