Csla 3.8 Video DEMO 005: ArrayDataReader fixes

Csla 3.8 Video DEMO 005: ArrayDataReader fixes

Old forum URL: forums.lhotka.net/forums/t/8563.aspx


Annesh posted on Tuesday, February 23, 2010

Hi Rocky

We have purchased your video series and it is great.

We are using your ArrayDataReader class to mock our databases just as you did in your demo005 but I have fixed the class to accomodate a single row of data and when the NextResult() is called it resets the rowcount to zero again. Please find fixes below:

 public bool NextResult()

{

_resultSet++;

 

if (_resultSet < _data.Count)

{

 

//------------------------------

_row = 0;

// reset row counter

 

//------------------------------

 

return true;

}

 

else

 

return false;

}

 

public bool Read()

{

_row++;

 

//------------------------------

 

// -1 not -2 because only one field header row

 

if (_row > _data[_resultSet].GetLength(0) - 1)

 

//------------------------------

 

return false;

 

else

 

return true;

}

RockfordLhotka replied on Tuesday, February 23, 2010

Thanks, I appreciate it!

Copyright (c) Marimer LLC