468,549 Members | 2,250 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,549 developers. It's quick & easy.

Is this viable method - returning DataSet

Hello list,

I have built a project in VS2005 which includes a Web Service Web Site. On
this server there is a Database. I have used the DataSet designer to link to
this database and VS2005 has created Table Adapters which connect to the
database and return the table data. My DataSet is called DatabaseDataSet. My
WebMethod for returning data from the server database is as follows -

[WebMethod]
public DataSet GetUserJobs(string id)
{
DatabaseDataSet ds = new DatabaseDataSet();

JobTableAdapter jobAdapter = new JobTableAdapter();
jobAdapter.FillJobsSelected(ds.Job, id);

return ds;
}

This works, but is this an OK way to do it?

Thanks for any opinions,
David
Nov 17 '06 #1
2 1372
Hi,

The right answer should be, "It depends", interop is the major issue here.
The Datasets are complex XML structures that are really hard to convert in
other platforms different from .NET. If your web service is going to be
consumed by different client platforms, for instance JAVA clients, the
datasets are not a good way to go. In that case, you should use simple XSD
types. (.NET classes decorated with XML serialization attributes).

Regards,
Pablo Cibraro.

"David++" <Da***@discussions.microsoft.comwrote in message
news:F6**********************************@microsof t.com...
Hello list,

I have built a project in VS2005 which includes a Web Service Web Site. On
this server there is a Database. I have used the DataSet designer to link
to
this database and VS2005 has created Table Adapters which connect to the
database and return the table data. My DataSet is called DatabaseDataSet.
My
WebMethod for returning data from the server database is as follows -

[WebMethod]
public DataSet GetUserJobs(string id)
{
DatabaseDataSet ds = new DatabaseDataSet();

JobTableAdapter jobAdapter = new JobTableAdapter();
jobAdapter.FillJobsSelected(ds.Job, id);

return ds;
}

This works, but is this an OK way to do it?

Thanks for any opinions,
David

Nov 17 '06 #2
Hi Pablo,

Thanks for taking the time to answer. Yes I agree that the main problem I
could run into is i I want other .NET clients to use this service, I would
have to be careful to return something which 'all' clients can understand.
I'll look into the method you suggested.

Best regards,
David

"Pablo Cibraro [MVP]" wrote:
Hi,

The right answer should be, "It depends", interop is the major issue here.
The Datasets are complex XML structures that are really hard to convert in
other platforms different from .NET. If your web service is going to be
consumed by different client platforms, for instance JAVA clients, the
datasets are not a good way to go. In that case, you should use simple XSD
types. (.NET classes decorated with XML serialization attributes).

Regards,
Pablo Cibraro.

"David++" <Da***@discussions.microsoft.comwrote in message
news:F6**********************************@microsof t.com...
Hello list,

I have built a project in VS2005 which includes a Web Service Web Site. On
this server there is a Database. I have used the DataSet designer to link
to
this database and VS2005 has created Table Adapters which connect to the
database and return the table data. My DataSet is called DatabaseDataSet.
My
WebMethod for returning data from the server database is as follows -

[WebMethod]
public DataSet GetUserJobs(string id)
{
DatabaseDataSet ds = new DatabaseDataSet();

JobTableAdapter jobAdapter = new JobTableAdapter();
jobAdapter.FillJobsSelected(ds.Job, id);

return ds;
}

This works, but is this an OK way to do it?

Thanks for any opinions,
David


Nov 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mike P | last post: by
3 posts views Thread by Mike P | last post: by
4 posts views Thread by C Downey | last post: by
2 posts views Thread by Anthony Biondo Jr | last post: by
15 posts views Thread by Joseph Geretz | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.