Pretty much the options I had thought - although on the json front I have used System.Web.Script.Serialization.JavaScriptSerializer for json serial and deserial isation
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Brian Leach Sent: 03 December 2012 16:15 To: 'U2 Users List' Subject: Re: [U2] uniobjects.net Simeon There isn't a single standard, it depends on a) how easy it is to generate the data in the first place and b) what you want to do with it after.. Going UniXML gives you the option to generate a dataset which is easy for binding but has large overheads, or more usefully to grab the content into an XDocument and parse it into List<something_useful> using LINQ whilst preserving the structure: the latter gives you more flexibility and you don't need to normalize or navigate the parent/child relations created in a dataset if you have multivalued data. Of course you don't have to use UniXML to bring back XML for LINQ - you can bring that back in a subroutine argument, having generated it directly in BASIC. If you create a template for your XML document and for the row and just use the CHANGE() function to populate placeholders, that's often quicker than calling out to the XML features in the database - just make sure you handle the escapes. Ditto JSON, but unless you're calling from a web service consuming context there isn't really the tooling exposed in .NET to then do anything useful with it (there is a LINQ provider for JSON but it converts it into XML behind the scenes before parsing). If you want to work raw returning data from a subroutine, you can delimit your records with char(255) and simply split() them on the client into an array and possibly List<T>.AddRange(array). But you would still then have to do the work of interpreting the individual record contents after separating them. All of which is an answer that is no answer.. Brian -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Symeon Breen Sent: 03 December 2012 15:55 To: 'U2 Users List' Subject: Re: [U2] uniobjects.net I could use a basic subroutine, but in order for it to return a couple of hundred records, it would have to either delimit the records somehow or generate an xml or json string, and I just wanted to see if there was a better/more standard way of doing this. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of [email protected] Sent: 03 December 2012 15:07 To: U2 Users List Subject: Re: [U2] uniobjects.net If the supposed access time for these records is rather quick, 200 records is a relatively small record set. Although there are technically more elegant ways of doing this, why cant you just stick with your proven basic subroutine call? On Mon, 3 Dec 2012 14:59:43 -0000, Symeon Breen wrote: > Ahh yes - upto about 200 ish > > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of > [email protected] > Sent: 03 December 2012 14:47 > To: [email protected] > Subject: Re: [U2] uniobjects.net > > For me the key is in how many is "a number of records"? > > > On Mon, 3 Dec 2012 14:48:45 -0000, Symeon Breen wrote: >> Hi - I have been using uniobjects.net for many years now, however >> I >> usually use it to call a basic subroutine on the u2 server. I now >> have a little project where I need to get a number of records from a >> file, ideally like the output of a list command as I have some itypes >> I also need to get. >> >> I could do this via a select list and read the ids into a unidataset >> and then call other programs to get the itype data, or I could do a >> unixml probably a few other ways. >> >> >> >> So what is the best way to do this ? >> >> >> >> >> >> >> >> Thanks >> >> Symeon. >> >> _______________________________________________ >> U2-Users mailing list >> [email protected] >> http://listserver.u2ug.org/mailman/listinfo/u2-users > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2012.0.2221 / Virus Database: 2634/5433 - Release Date: > 12/02/12 > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2221 / Virus Database: 2634/5433 - Release Date: 12/02/12 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2012.0.2221 / Virus Database: 2634/5433 - Release Date: 12/02/12 _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
