Problem passing a typed dataset to a web service

J

Justin Crossley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top