Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Problem passing a typed dataset to a web service

Reply
Thread Tools

Problem passing a typed dataset to a web service

 
 
Justin Crossley
Guest
Posts: n/a
 
      11-17-2004
I'm having a type mismatch problem when trying to pass a typed dataset to a
web service.

My code is:

CLIENT CODE

I have a dataset schema file called MainData.xsd containing a table called
mytable

'create and fill typed dataset
Dim dsMain As New MainData
Dim con As New SqlConnection("myconnectionstring")
Dim da As New SqlDataAdapter("select * .....", con)
da.Fill(dsMain.mytable)

'pass typed dataset to web service
Dim ws As New localhost.DataTransfer
ws.PassData(dsMain)

WEB SERVICE CODE

The web service also has an identical local file containing the data schema
called MainData.xsd

<WebMethod()> Public function PassData(Value as MainData)
....
End Function


Unfortunately I get an error when I hover over the PassData method that says
'Value of Type MainData cannot be converted to localhost.MainData'.

It is obviously treating the two data types as being different.

If I change the parameter type of the PassData function to type DataSet then
the function can be called OK, but then I lose the type information.

Any ideas anybody?

Thanks

Justin Crossley


 
Reply With Quote
 
 
 
 
Dino Chiesa [Microsoft]
Guest
Posts: n/a
 
      11-18-2004
I think I saw that you asked this somewhere else.

try this.
http://msdn.microsoft.com/library/en...ce07162002.asp

-D

"Justin Crossley" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm having a type mismatch problem when trying to pass a typed dataset to
> a web service.
>
> My code is:
>
> CLIENT CODE
>
> I have a dataset schema file called MainData.xsd containing a table called
> mytable
>
> 'create and fill typed dataset
> Dim dsMain As New MainData
> Dim con As New SqlConnection("myconnectionstring")
> Dim da As New SqlDataAdapter("select * .....", con)
> da.Fill(dsMain.mytable)
>
> 'pass typed dataset to web service
> Dim ws As New localhost.DataTransfer
> ws.PassData(dsMain)
>
> WEB SERVICE CODE
>
> The web service also has an identical local file containing the data
> schema called MainData.xsd
>
> <WebMethod()> Public function PassData(Value as MainData)
> ...
> End Function
>
>
> Unfortunately I get an error when I hover over the PassData method that
> says 'Value of Type MainData cannot be converted to localhost.MainData'.
>
> It is obviously treating the two data types as being different.
>
> If I change the parameter type of the PassData function to type DataSet
> then the function can be called OK, but then I lose the type information.
>
> Any ideas anybody?
>
> Thanks
>
> Justin Crossley
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference Between Typed Dataset and Untyped Dataset thomson ASP .Net 2 01-19-2005 08:16 AM
Converting a generic Dataset to a typed dataset William Gower ASP .Net 2 07-26-2004 10:14 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 2 10-31-2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 1 10-31-2003 02:39 AM



Advertisments