Why do you have to have a session going to manipulate an array you have
already read in?  Why can't I read in

the array, close the connection,. Then manipulate the array (insert
command,etc) it without having a persistent connection, then if I NEED
to write

it back, I can reopen up a connection and write it back....



Can someone explain the basics ?



Thanks!





Quick Guide - Out of Uniobjects  for .Net doc

The following code sample written in C# provides a quick guide for
software developers working in UniObjects for .NET.

using System;

using IBMU2.UODOTNET;

UniSession us1=null

try

{

us1=UniObjects.OpenSession("DENVER\\asmith","xxxi","localhost",

"DEMO","UDCS");

//open customer file

UniFile fl=us1.CreateUniFile("customer");

//use UniDataSet

string[]sArray={"2","3", "4"};

UniDataSet uSet=fl.ReadRecords(sArray);

UniRecord q2=uSet["2"];

string sq2=q2.ToString();

UniRecord q3=uSet["3"];

string sq3=q3.ToString();

UniRecord q4=uSet["4]'

string sq4=q4.ToString();

//use UniCommand

UniCommand cmd=us1.CreateUniCommand();

cmd.Command="List VOC SAMPLE 10";

cmd.Execute();

string response_str=cmd.Response;

Console.WriteLine("Response from UniCommand:",response_str);




Code Samples for UniObjects for .NET 5-4 C:\Program
Files\Adobe\FrameMaker7.0\Universe



//test UniDynArray

UniDynArray pArray=us1.CreateUniDynArray("a");

pArray.Insert(1,"b");

pArray.Insert(1,"c");

pArray.Insert(1,"d");

Console.WriteLine("Result from UniDynArray is:",pArray.ToString());

UniDynArray ur = pArray.Extract(2);

Console.WriteLine("Result from UniDynArray Extract is:",ur.ToString());

ur=pArray.Extract(3);

Console.WriteLine("Result from UniDynArray Extract is:",ur.ToString());

}

catch(Exception ex)

{

if(us1 !=null && us1.isActive)

{

UniObjects.CloseSession(us1);

us1=null

}

MessageBox.Show(ex.Message);

}

finally

{

if(us1 !=null && us1.IsActive)

{

UniObjects.CloseSession(us1);





Patricia M. Wilson

MIS Programmer

x 3095

813.635.3095

[EMAIL PROTECTED]
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to