Webservices and strongly typed datasets

Discussion in 'ASP .Net Web Services' started by Thomas Zaleski, Jul 9, 2003.

  1. Dear group,

    I have a webservice which I use as a datalayer. Basically its function
    is to fill a strongly typed dataset with data and return it to my
    webapplication that called it.

    My webservice has the following method:

    <WebMethod()> Public Function FillCatalog(ByVal ds As catalogds) As
    catalogds
    Dim myConnection As SqlConnection = New
    SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
    Dim myDataAdapter As SqlDataAdapter = New
    SqlDataAdapter("procCatalogGetList", myConnection)

    myDataAdapter.SelectCommand.CommandType =
    CommandType.StoredProcedure

    myConnection.Open()

    myDataAdapter.TableMappings.Add("Table", "products")
    myDataAdapter.TableMappings.Add("Table1", "productprice")
    'sda.TableMappings.Add("Table2", "productspecial")

    myDataAdapter.Fill(ds)
    myConnection.Close()

    Return ds
    End Function


    Now if I create a aspx file in that project to call this using the below
    code:

    Dim catalogds As catalogds

    Dim dp As vna = New vna
    catalogds = New catalogds
    dp.FillCatalog(catalogds)

    Dim pr As catalogds.productsRow =
    catalogds.products.FindByproduct_id(productid)
    Dim ppr As catalogds.productpriceRow() = pr.GetproductpriceRows


    This code works fine locally. But if I try to run this code on my
    webapplication that has consumed the webservice, it seems that the
    dataset comes back empty. The code I use on my webapplication (assuming
    the reference to the webservice is 'vna') is as follows:


    Dim catalogds As vna.catalogds

    Dim dp As vna.vna = New vna.vna
    catalogds = New vna.catalogds
    dp.FillCatalog(catalogds)

    Dim pr As vna.catalogds.productsRow =
    catalogds.products.FindByproduct_id(productid)

    Dim ppr As vna.catalogds.productpriceRow() = pr.GetproductpriceRows

    The error occurs in the last line of code. It is acting as if there is
    no data in the dataset. Has anyone any similar experience with this?
    Please let me know.

    Thanks

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Thomas Zaleski, Jul 9, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Big D

    Strongly typed datasets and XML

    Big D, Feb 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    442
    bruce barker
    Feb 17, 2004
  2. Duncan Welch

    Strongly typed datasets and nested repeaters

    Duncan Welch, Apr 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,014
    MattC
    Apr 7, 2005
  3. chris
    Replies:
    2
    Views:
    2,032
    chris
    Feb 25, 2006
  4. Mike P

    strongly typed datasets

    Mike P, Aug 30, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    346
    Mike P
    Aug 30, 2006
  5. Ben
    Replies:
    0
    Views:
    328
Loading...

Share This Page