L
Landley
I have created some classes that have a datarow as a datasource and
properties for reading from or writing to the datasource (see example
below). I have used this solution to separate the data layer, so the 2nd
hand developer does not need to know the data structure.
1. I create a dataset based on a SQL statement
2. I retrieve a datarow from the result(s) and pass the row as an argument
in a class constructor.
3. In the class constructor, I set the datasource.
4. Each property refers to each column in the datarow.
Are there any issues that I should be made aware of using this method?
Would this method perform faster that iterating through a datareader,
instantiating a class and populating each property in turn?
L.
properties for reading from or writing to the datasource (see example
below). I have used this solution to separate the data layer, so the 2nd
hand developer does not need to know the data structure.
1. I create a dataset based on a SQL statement
2. I retrieve a datarow from the result(s) and pass the row as an argument
in a class constructor.
3. In the class constructor, I set the datasource.
4. Each property refers to each column in the datarow.
Are there any issues that I should be made aware of using this method?
Would this method perform faster that iterating through a datareader,
instantiating a class and populating each property in turn?
L.