passing data from datareader between methods

Results 1 to 2 of 2

Thread: passing data from datareader between methods

  1. #1
    Join Date
    Dec 1969

    Default passing data from datareader between methods

    In my page_load method I am calling another method (methodB) of the same page class which looks up a single row recordset from SQL Server.<BR><BR>The info needs to be returned from this method back to the page_load class.<BR><BR>As the datareader is for connected reding of the database it is clear to me that this is not the object I should return from methodB.<BR><BR>So my question is what would be a good structure to return this as.<BR><BR>Dataset - I think has too much overhead?<BR>Datatable - perhaps?<BR>XML - would mean creating a XML object toi get at the info<BR>an array - the dimensions arent named so means that the calling method needs to know which info is in which dimension of the array<BR>Comma seperated string is too simple and suffers from the same as the array - you dont know which info is held between each comma?<BR>A user defined type - perhaps this makes sense<BR>Or set class scope variables in MethodB - so that when control is returned to the page_load it can refer to these class scope variables <BR><BR>let me know your thoughts<BR><BR>thanks<BR><BR>I am interested what peoples opinions are on this<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: passing data from datareader between methods

    If its a single row, I would return it as a tableRow

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts