ASP.Net  Bind a Web service to a variable

Posted on 2006-05-31
Last Modified: 2012-06-21

I have a web service that I call in the following manner in my ASP.Net application.

    Dim ConsumeWebService As
            ConsumeWebService = New

This returns just one field, and I want to bind the field to a variable within my project.  I cannot find any examples on how to do this.  Any examples would be appreciated!?

I'm guessing it would be something along the following lines..

  VARIABLENAME.VALUE = ConsumeWebService.GetStatementAnswers(Username, Password, PAR1, PAR2)


Question by:kinton
    LVL 2

    Author Comment

    It should be noted, the web service is returning the data as a dataset
    LVL 96

    Accepted Solution

    Dim ConsumeWebService As New
    Dim ds As DataSet = ConsumeWebService.GetStatementAnswers(Username, Password, PAR1, PAR2)

    LVL 2

    Author Comment

    ok, that seems to work, how can I pull the individual values out of that dataset?
    LVL 96

    Expert Comment

    by:Bob Learned
    Here is an example of one way:

    Dim table As DataTable = ds.Tables(0)
    Dim row As DataRow = table.Rows(0)
    Dim name As String = row("Name").ToString()

    It really depends on what you need as to how to best handle it.

    LVL 2

    Author Comment

    That's perfect.   Thanks for the quick reply!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now