On 7/25/2004 11:43 PM, William Gower wrote:
I have a method called RetrieveAll that returns a Dataset
The object that is calling this method expects to receive a UserDS. I don't
want the RetrieveAll to have to know about the UserDS but just return a
dataset and the calling method will convert it to a specific typed dataset.
How do I do this?
Dim dalc as New UserDALC
Dim user As New UserDS
user = dalc.RetrieveAll()
Does the dalc class have a .Fill method of some sort? To be honest, any
data access layer object I create that 'returns data' has this, as alot
of times a caller may ask to fill an existing structure, instead of
always getting a newly-created return structure. Then you could just
create a typed dataset in the above code and pass to the dalc.Fill(..)
method...
Otherwise you'd pry have to write some utility to copy the data and
structures from one DataSet to the other...
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET