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

Home Posts Topics Members FAQ

Passing dataset to web service

Bob
Hi,

Can anyone tell me how to resolve this:

I am calling a web service from a WinForm app and passing a typed dataset as
a parameter. I have added the dataset to the web service project but I get
an error telling me that the WinForm dataset can't be converted to the web
service dataset - even though they are exactly the same.

How do I get around this? I have tried using CType and DirectCast but always
get a "specified cast is invalid" error.

I am sure there is a simple solution to this but I can't find it.... and I
don't want to resort to using an untyped dataset on the web service side of
things (which I know I can get to work).
Cheers
Nov 21 '05 #1
2 1449
Have you tried writing the dataset data and the dataset schema out and
passing that to you other dataset (and then read that schema and data xml
into it)?
"Bob" <1@2.3> wrote in message
news:e%****************@TK2MSFTNGP10.phx.gbl...
Hi,

Can anyone tell me how to resolve this:

I am calling a web service from a WinForm app and passing a typed dataset
as
a parameter. I have added the dataset to the web service project but I get
an error telling me that the WinForm dataset can't be converted to the web
service dataset - even though they are exactly the same.

How do I get around this? I have tried using CType and DirectCast but
always
get a "specified cast is invalid" error.

I am sure there is a simple solution to this but I can't find it.... and I
don't want to resort to using an untyped dataset on the web service side
of
things (which I know I can get to work).
Cheers

Nov 21 '05 #2

"Bob" <1@2.3> wrote in message
news:e%****************@TK2MSFTNGP10.phx.gbl...
Hi,

Can anyone tell me how to resolve this:

I am calling a web service from a WinForm app and passing a typed dataset
as
a parameter. I have added the dataset to the web service project but I get
an error telling me that the WinForm dataset can't be converted to the web
service dataset - even though they are exactly the same.

How do I get around this? I have tried using CType and DirectCast but
always
get a "specified cast is invalid" error.

I am sure there is a simple solution to this but I can't find it.... and I
don't want to resort to using an untyped dataset on the web service side
of
things (which I know I can get to work).


The immediate cause of your problem is that you have created two different
types.

MyWinform.DataSet1
and
MyWebService.DataSet1

Since they are not the same type, you can't do CType or DirectCast. Try
using the same type (not just the same schema) for both projects.

David
Nov 21 '05 #3

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

Similar topics

3
4732
by: Simon Harvey | last post by:
Hi, In my application I get lots of different sorts of information from databases. As such, a lot of information is stored in DataSets and DataTable objects. Up until now, I have been passing...
22
25541
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
3
3523
by: GBR | last post by:
I have a collection object inherited from collection base that is used to carry my object entities from server to client through a web service. I want to add a dataset to this collection object and...
12
5286
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
5
1611
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
1
1243
by: rocky20 | last post by:
I am new to .NET and I'm trying to move data from a local database to a remote database. The only way to access the remote database is through a web server. What I want to do is pull the records...
1
1813
by: Deecrypt | last post by:
Hi, Passing a string parameter to a webservice to get the dataset generated as the result, seems to give me an error suggesting that no parameter is being passed. However it works if I explicitly...
4
5908
by: John Sheppard | last post by:
Hello there I was wondering if anyone could help me, I am trying to pass a typed dataset to a dialoged child form by reference. I have binding sources sitting on the child form. So to refresh...
5
1957
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...
0
7037
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
6904
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
7032
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,...
0
7076
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...
1
6730
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
5321
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,...
1
4767
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...
0
2990
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
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.