Consume Web Service

Hello, I'm trying to consume a web service located here:
I have added the reference and am trying to get it to display the information properly. Curently I'm attempting to databind the information obtained in a gridview control with:

Dim stockquote As net.webservicex.www.StockQuote

            stockquote = New net.webservicex.www.StockQuote

            gvStockQuote.DataSource = stockquote.GetQuote("DELL")


This does bind the data to the gridview but each character is displayed on it's own line in the same column. How can I display it better? It is to view the current company stock data.
Who is Participating?
Abu HamdanConnect With a Mentor Enterprise Architect, PM ExpertCommented:
Abu HamdanEnterprise Architect, PM ExpertCommented:
You should use XSD to format these xml into typed dataset and then pass the created dataset to the grid
Read more on this subject:
gogetsomeAuthor Commented:
Thanks hammdan for your replay. I read what I could understand from your link and am trying this:

  Dim stockquote As net.webservicex.www.StockQuote

            stockquote = New net.webservicex.www.StockQuote

            Dim ds As DataSet = New DataSet
            ds.ReadXml(stockquote.GetQuote("BBOX"), XmlReadMode.Auto)

            gvStockQuote.DataSource = ds


it is throwing the following error:
Illegal characters in path

What am I doing wrong?
gogetsomeAuthor Commented:
WOW! Thanks hammdan! Great find.

Naturally it is in c# and I work in VB. I have a conversion utility but it is failing at this particular conversion. The points are yours for sure, but would it be too much to ask for help in the conversion?

        //Create a StockQuote Object
        StockQuote s = new StockQuote(txtSymbol.Text);

        //Get the RawXml
        txtQuote.Text = s.RawXml;

        //Display the contents of the Quote's Parameters
        lblNVC.Text = string.Empty;
        foreach (string key in s.Parameters.Keys)
            lblNVC.Text += key + " --> " + s.Parameters[key] + "<br/>";

        //Display selected parameters
        lblSymbol.Text = s.Symbol;
        lblLast.Text = s.Last;
        lblChange.Text = s.Change;
        lblAt.Text = s.QuoteDateTime.ToString("MMM dd yyyy HH:mm");
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.