How do I return typed datasets from a web service (.NET 2.0) which will appear in the 'data sources' pane of a Windows program?


i using .net 2005.     have created web service have added 'web reference' windows program because want consume data web service.

all of microsoft documentation tells me if return typed datasets web service datasets appear in 'data sources' pane of windows program (also .net 2005) , can use data if dealing local data.   cannot find anywhere in documentation, way of defining methods in web service achieve this.

i have created typed dataset in web service (using 'dataset' design surface table adapter).   code using return dataset:

    <webmethod()> public function units() data.dataset
        dim myds new units
        dim myta new unitstableadapters.daunitstableadapter
        myta.fill(myds.dsunits)
        return myds
    end function

rightly or wrongly way can see how not dataset appearing in window's program 'data sources' pane.   can help?

the web service method needs return typed dataset type not plain dataset:

public function units() data.dataset
        dim myds new units
        dim myta new unitstableadapters.daunitstableadapter
        myta.fill(myds.dsunits)
        return myds
    end function

needs be

public function units() units   'return units type
        dim myds new units
        dim myta new unitstableadapters.daunitstableadapter
        myta.fill(myds.dsunits)
        return myds
    end function


also not thinks idead, when create dataset give suffix of dataset, easy tell class dataset @ quick glance.  i.e. unitsdataset , function getunitsdataset


Archived Forums A-B  >  ASMX Web Services and XML Serialization



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'