473,473 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strongly typed datasets and web services

I am developing a web service in VB.Net that returns data from a server.
I have an .asmx page that uses a strongly typed dataset and I would like
to return data in the form of strongly typed data table rows. However I
always get an error message to do with the fact that the data set is not
serializable. For example: "You must implement the Add(System.Object)
method on xyz data table because it inherits from IEnumerable."

The strongly typed data set objects are created automatically in Visual
Studio from the data set schema. Is there a way to force Visual Studio
(2003 version) to implement the necessary methods to make the data set
serializable?

Peter

*** Sent via Developersdex http://www.developersdex.com ***
May 16 '06 #1
1 1882
"A class that implements IEnumerable must implement a public Add method that
takes a single parameter. The Add method's parameter must be of the same
type as is returned from the Current property on the value returned from
GetEnumerator, or one of that type's bases. "

That said, support for datatable object in 2003 for what you are trying to
do is not a simple matter. Try returning it back as another dataset (create
it at that end and copy the table) and then returning that dataset. Or
upgrade to VS 2005. Though I have not tested it I have heard this problem
goes away in 2.0.
--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"PeterH" <no****@devdex.com> wrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
I am developing a web service in VB.Net that returns data from a server.
I have an .asmx page that uses a strongly typed dataset and I would like
to return data in the form of strongly typed data table rows. However I
always get an error message to do with the fact that the data set is not
serializable. For example: "You must implement the Add(System.Object)
method on xyz data table because it inherits from IEnumerable."

The strongly typed data set objects are created automatically in Visual
Studio from the data set schema. Is there a way to force Visual Studio
(2003 version) to implement the necessary methods to make the data set
serializable?

Peter

*** Sent via Developersdex http://www.developersdex.com ***

May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
3
by: MC D | last post by:
I have a situation in which I have a strongly typed dataset based on the schema of a xml document. This works great, and OMG I love strongly typed datasets... ;o) However, The situation I have...
7
by: Jeff | last post by:
I want to remote several strongly typed datasets and I don't want to distribute the assemblies. I wish to create interface assemblies for these datasets but I don't know where to start. I've...
0
by: Bj?rn Mor?n | last post by:
I am consuming a web service that returns arrays of classes which can contain other classes (a hierarchy of data). Is there a simple way to move the data into a typed DataSet without writing too...
1
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
1
by: herbert | last post by:
Does VS.2005 support strongly typed datasets between PocketPC and Web Services? I have a project stalled and must decide whether to wait for VS.2005 or go back to untyped DataSets. thanks...
2
by: chris | last post by:
Hello all, Background: Using .NET 2.0, Sql Server 2005, SqlCacheDependency is utilized successfully against SqlCommand objects elsewhere in the code (in other words I have successful instances...
1
by: Mike P | last post by:
I have been trying out using strongly typed datasets in VS 2005, and I have to say that I don't like them...they produce loads of auto-generated code, and I would much rather create a single class...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.