Most efficient way to return multiple values to client

M

Michael Hetrick

I'm writing an Active Directory web service and need to return multiple
properties of a single user. The web service receives the username and
looks up the properties of the user in Active Directory. This works fine.

If I look-up the first name, last name, email, telephone, city, state, and
zip, should I create a dataset or create a user object in the service to
return to the client? I am looking for the most efficient way to do this -
an on-the-fly dataset or serialization/deserialization of a user
class/object.

Thanks-
Michael
 
M

MSFT

Hi Michael,

I prefer to create a new class in web service to return the info about a
user. DataSet also need to be serialization/deserializtion from webservice
to client. When programming on client side, it is more clear and easy to
use with a class than a dataset. For example:

MyUser.Telephone

VS

MyDataset.Tables("MyUsers").rows(1)("Telephone")


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Michael Hetrick

Thanks. Is it more of a code readability convention or is it really more
efficient?

Michael
 
M

MSFT

Hi Michael,

I mean code readability in my previous email. With Datset, you may need
more code on client side; With a class, you may need more code on server
side. Regarding the efficent, I think there is no big difference between
them.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top