I'm trying to get an example running on my computer which comes packaged in the C:\IBM\UniDK\uonet\samples\C#
directory. The name of the project is UniSelectList
.
This exact code, works perfectly on just one of our machines.
At first I thought it may be a wrong reference to the DLL file IBMU2.UODOTNET
, but even taking the DLL file from the working machine does not allow it to run.
Each machine is on the same network, all firewalls disabled.
This is the exception message that we're receiving:
SocketException caught!!!SystemNo such host is known[IBM U2][UODOTNET - UNIRPC][ErrorCode=81011] The host name is not valid, or the host is not responding Source: UniRPCConnection Class Method: Void set_Host(System.String) at IBMU2.UODOTNET.UniRPCConnection.set_Host(String value) at IBMU2.UODOTNET.UniSession.Connect()
using System;
using IBMU2.UODOTNET;
namespace IBMU2.Samples.UniSelectListSample
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class UniSelectListSample
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
UniSession us1=null;
try
{
us1 = UniObjects.OpenSession("92.0.0.1","username","password","play/PLAYSMD","uvcs");
UniSelectList sl = us1.CreateUniSelectList(2);
// Select UniFile
UniFile fl = us1.CreateUniFile("SLCUST");
sl.Select(fl);
bool lLastRecord = sl.LastRecordRead;
while(!lLastRecord)
{
string s = sl.Next();
Console.WriteLine("Record ID:" + s);
lLastRecord = sl.LastRecordRead;
}
}
catch(Exception e)
{
if(us1 != null && us1.IsActive)
{
UniObjects.CloseSession(us1);
us1= null;
}
Console.WriteLine("");
string s = "Connection Failed : " + e.Message;
Console.WriteLine(s);
}
finally
{
if(us1 != null && us1.IsActive)
{
Console.WriteLine("");
string s = "Connection Passed";
Console.WriteLine(s);
UniObjects.CloseSession(us1);
}
Console.ReadLine();
}
}
}
}
I can ping the IP address and I can receive a reply.
Am I missing a reference?