473,756 Members | 3,973 Online
Bytes | Software Development & Data Engineering Community
+ 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 1463
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%******** ********@TK2MSF TNGP10.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%******** ********@TK2MSF TNGP10.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.DataS et1
and
MyWebService.Da taSet1

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
4758
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 around chunks of data in DataTables/DataSets, simply because that was the format that they were in when the data was taken from the database. Now, I know this maybe a pretty silly question with a standard "it depends" answer, but I'm going to...
22
25600
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 compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet = ws.VerifySku(cartSet)
3
3547
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 send it across. But when it gets to the web server, its failing. Any help would be abvised? Is this possible? Can I add a dataset object and add it into the collection array and pass it across?
12
5342
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 the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
5
1637
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
1
1256
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 I need from my local database and pass them to a web page which will loop through the records and call a stored procedure on the remote database to insert them into a table . I am using VB 2005 and SQL Server 2000. I have worked out the first...
1
1838
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 state the value as the parameter. Code in Csharp being developed in VS2005 for ASP.NET. Below is my webservice code. public DataSet findAAPAssessment(string assessmentID) {
4
5931
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 them I just set their datasource. I am guessing this is probably what is causing the problem. Is there a better way to do this? Anyway this all works happily and things show up when the record already exists but I have 2 problems ; 1) When I add...
5
1973
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
10031
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9869
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...
0
9708
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
7242
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
6534
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
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
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
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.