Click or drag to resize

C\# example

To work in C# you just need to add a reference to the COM DLL SuperOfficeDB.

The .net framework will automatically generate wrapper classes for you. The namespace should be created automatically: SuperOffice.COM.SuperOfficeDB

 

The DatabaseClass represents the Database object that you would normally create. You then use the COM API as you normally would.

 

using SuperOffice.COM.SuperOfficeDB;      Database db = new DatabaseClass();    bool isOk = db.Login("username", "password");    if( isOk )    {      SOContact cont = db.GetContact(2);      Console.WriteLine(cont.Name);      Console.WriteLine(cont.FormattedAddress);    }    else      Console.WriteLine("Unable to log in to database");

 

Get a user-defined list (in C#)

using SuperOffice.COM.SuperOfficeDB; namespace MyLittleSpace {   public class GetAUDefMdoList   {     public static void Main(string[] args)     {        db = new DatabaseClass();        bool isOk = db.Login("USER", "PASS");        if( isOk )        {           IListTextItem listdef = db.GetListItemByName( SOTableId.enTableUDListDef, "My Userdefined list name");           IListTextItems udeflist = db.GetList(  SOTableId.enTableId_UDEFOFFSET + listdef.Id );           foreach(IListTextItem item in list)           {               // do something with Item.Text;           }           IListTextItem item5 = db.GetListItem( SOTableId.enTableId_UDEFOFFSET  + listdef.Id, 5);        }     }   } }

This example is written using Visual Studio.net 2003

Up: SuperOfficeDB Examples   Prev: Add A List Item   Next: C++ #import example          Edit