Posts

Showing posts from February, 2017

Connecting to UniObjects via .NET using UODOTNET

Image
This tutorial assumes you've installed UniDK and have access to the  UODOTNET.dll. The dll should be available from C:\IBM\UniDK\uonet\bin. This tutorial will use Visual Studio to connect to a UniVerse database. Start by opening Visual Studio and creating a new Windows Forms Appicaltion. Next you can choose to add a button to connect and one to disconnect. I'm also adding a Label in order to tell us whether the connection is active or deactivated. Now go and view your Form1 code (F7). Next add the UODOTNET.dll into your References. Right-click References > Add Reference > Browse... > C:\IBM\UniDK\uonet\bin > Select UODOTNET.dll > Click OK. Your References should now include the UODOTNET.dll Next picture shows you the a sample of how to connect. You'll need 5 parameters to send the UniObjects class OpenSession() method. You can also specify a port if needed. Server / Hostname - The name or network address of the instance of U2 Database to whi...

Dates in UniVerse Basic

So dates we tend to use them quite often, especially in financial or accounting transactions. Having sound knowledge of how to format or display them will make life easier. I'll go through an example of how dates operate in this environment. Internally in UniVerse Basic a date is a numeric character of 5 digits long. So if I took today's date which is 13/02/2017 it would be equivalent of 17942 as an internal format. To get the internal format you'd have a function like this: INTERNAL.DTE = ICONV(13/02/2017, 'D4/DMY[2,2,4]') Variable internal date will have the value 17942 . Note that there are two parameters in the function. The first one is the date and the second the format. Let's break down that format to make it a bit more clear. D4/ - The 'D' tells us we're working with a date. The numeric '4' tells us the number of digits for the year input. Now the slash character tells us which separator we're using. DMY[2,2,4] -  ...