473,657 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(str ing id)
{
DatabaseDataSet ds = new DatabaseDataSet ();

JobTableAdapter jobAdapter = new JobTableAdapter ();
jobAdapter.Fill JobsSelected(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 1568
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***@discussi ons.microsoft.c omwrote in message
news:F6******** *************** ***********@mic rosoft.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(str ing id)
{
DatabaseDataSet ds = new DatabaseDataSet ();

JobTableAdapter jobAdapter = new JobTableAdapter ();
jobAdapter.Fill JobsSelected(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***@discussi ons.microsoft.c omwrote in message
news:F6******** *************** ***********@mic rosoft.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(str ing id)
{
DatabaseDataSet ds = new DatabaseDataSet ();

JobTableAdapter jobAdapter = new JobTableAdapter ();
jobAdapter.Fill JobsSelected(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
51731
by: Mike P | last post by:
Is it possible to return a dataset from a stored procedure, or would you need to write the SQL in your .cs file to return the dataset? Any assistance would be really appreciated. Cheers, Mike
3
1220
by: Mike P | last post by:
I have written a method that is meant to return a dataset from a SQL Server table (or not if there is nothing there to return). My app regularly times out and crashes at this point and I don't know why. Here is my method : public DBResult Get_Prepay_Dataset(out DataSet dsPrepay, string strCUG, string strSubcugPrepayQuery, DateTime dtmStartDatePrepayQuery, DateTime dtmEndDatePrepayQuery) { DBResult dbrGetPrepayDataset;
4
1870
by: C Downey | last post by:
I am creating a data access layer and I'm interested in the best method of returning data to my business tier. My database is SQL Server 2000, and I use stored proc's. Is it better for me to use a dataReader to get the data from the SQL server, then load it into an arrayList and return the arrayList to my business layer or should I use the dataset and just return that object from DAL to my business layer. The reason I would either use...
1
2573
by: Ed. | last post by:
I have an ArrayList of objects of class C. I need to return the list via a web method. What's the best approach? If I convert the list into a DataSet I could return the DataSet, but how would I do that? Do I need to create a strongly typed DataSet from my class C? Thanks.
0
1043
by: Alan | last post by:
I have successfully created DLL and registered. And run in webpage using VBScript. However, I have a method returning a typed dataset, do I need to do anything on DLL so that the VBScript can hold this returning typed dataset ? Or that is the matter of VBScript side ?
1
1133
by: rao | last post by:
I have a C# Web Service with several methods. If I try to access a method that returns a dataset based on a specific criteria and another user tries to access the same method with a different criteria and we keep executing it several times from different machines then every once in a while he'd end up with the dataset that I was sipposed to get and I'd get his data. I have unsuccessfully tried several things - it seems like the web...
2
1927
by: Anthony Biondo Jr | last post by:
I am trying to figure out the best way to return data through a web service. If the value is a single value I can just set it equal to the web service name. If I am returning a set of data I have seen a couple ways to do this. The dataset coming back to me is a SybaseASE Data Reader. Any help you can provide would be much appreciated. thanks, Anthony Right now I have done the following:
15
13502
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data between application tiers. In fact, there are whole books written on the subject.
5
1969
by: Eric Fortin | last post by:
I have a disconnected handheld device that I want to send the results of the day to a database through a web service (on an intranet) What's the best method to do this? XML? Tab Delimited/Carriage Return String? Through a file? Other?
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.