I am trying to parse out some xml data into some textboxes. This code works
In the example the xml outputs to a hard coded text box. I would like to set this code up to be used on other textboxes too. So I set up something like this:Code:'xml request code hard coded textboxes. Dim path As String = DirectCast(Me.MdiParent, main_form).dir_path Dim XMLD As XmlDocument Dim XMLN As XmlNode Try XMLD = New XmlDocument() XMLD.Load(path + "\test2.xml") XMLN = XMLD.SelectSingleNode("/market_stat") min_ma_isogen_avg_buy.Text = XMLN.Item("avg_buy_price").InnerText min_ma_isogen_avg_sell.Text = XMLN.Item("avg_sell_price").InnerText min_ma_isogen_buy_vol.Text = XMLN.Item("total_buy_volume").InnerText min_ma_isogen_sell_vol.Text = XMLN.Item("total_sell_volume").InnerText Catch ex As Exception Debug.Print(ex.ToString()) End Try
This does not work when called like this:Code:Private Sub update_prices(ByVal N1 As String, ByVal N2 As String, ByVal N3 As String, ByVal N4 As String, ByVal N5 As String, ByVal N6 As String) Dim path As String = DirectCast(Me.MdiParent, main_form).dir_path Dim XMLD As XmlDocument Dim XMLN As XmlNode Try XMLD = New XmlDocument() XMLD.Load(path + "\test2.xml") XMLN = XMLD.SelectSingleNode("/market_stat") N3 = XMLN.Item("avg_buy_price").InnerText N4 = XMLN.Item("avg_sell_price").InnerText N5 = XMLN.Item("total_buy_volume").InnerText N6 = XMLN.Item("total_sell_volume").InnerText Catch ex As Exception Debug.Print(ex.ToString()) End Try End Sub
If I put a stop in at the N6 line I can see all the N3-N5 have the correct value from the XML document but it does no display in the text boxes on the button click. FYI the N1 and N2 are tacked on the end of a URL and I am not using the URl in the example.Code:update_prices(type_id, region_var, min_ma_isogen_avg_buy.Text, min_ma_isogen_avg_sell.Text, min_ma_isogen_buy_vol.Text, min_ma_isogen_sell_vol.Text)
So why is it not outputting to the textboxes? I am not getting an error messages.
Thanks


Reply With Quote