Re: Best Method Question: Passing Numerous Transactions To Web Service

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Eric Fortin" <emfortin@xxxxxxxxxxx> wrote in message news:exgq9vZIJHA.728@xxxxxxxxxxxxxxxxxxxxxxx
I am currently passing a dataset and am being told that is "bad practice". What is the current thought for "best practice"

DataSets or any other .NET-specific types are bad practice in the sense that they are not interoperable. Instead, follow the Data Transfer Object pattern by returning simple types, arrays, structs, etc. For instance, to emulate a multiple-table DataSet:

public struct Table1Row {
public int ID {get;set;;}
public string Column {get;set;}
}

public struct Table2Row {
public int ID {get;set;;}
public string Column {get;set;}
public Table1Row RelatedRow {get;set;}
}

public class Table1 : List<Table1Row>
{
}

public class Table2 : List<Table2Row>
{
}

public class DataSet {
public Table1 Table1 {get;set;}
public Table2 Table2 {get;set;}
}

OTOH, if you don't now, nor ever will, care about interoperability, then go ahead and use a DataSet.
--
John Saunders | MVP - Connected System Developer

.



Relevant Pages

  • Re: Tricky Visual Basic Code help...
    ... moves the current record into a new record in table2. ... this with a little VBA code and a couple custom queries. ... Set a "pushFlag" column in the record in table1 to a specific ... If a duplicate is not found, ...
    (microsoft.public.access.formscoding)
  • Re: Help needed with importing XML
    ... You could add a gratuitous identity column to #temp and use ... Those examples showed how to decompose arbitrary XML in multiple ... table1 and table2. ... But there has to be something in the relational schema tying table1 ...
    (microsoft.public.sqlserver.xml)
  • Re: 2 column pulldown
    ... Allen Browne - Microsoft MVP. ... these field heading names come from Table2 since it is a lookup and so ... Table1 of course only has a single column name ... fieldX from Table1 is pulldown revealing candidate values of Table2. ...
    (microsoft.public.access.forms)
  • Re: Sliding and page breaks
    ... but I still have one nagging formatting problem. ... each entry in table1. ... simply pulls the first match in table2 instead of showing all the ... Otherwise I was thinking along the lines of your 2nd suggestion of using some calcs to consolidate the data down to a smaller number of tables used in the layout. ...
    (comp.databases.filemaker)
  • Re: 2 column pulldown
    ... Allen Browne - Microsoft MVP. ... these field heading names come from Table2 since it is a lookup and so ... Table1 of course only has a single column name ... fieldX from Table1 is pulldown revealing candidate values of Table2. ...
    (microsoft.public.access.forms)