Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
shawn313
Gallente
|
Posted - 2010.12.21 06:44:00 -
[1]
need a little help with some code here is the code i use to get the xml file
Quote: Dim wr As HttpWebRequest = CType(WebRequest.Create("http://api.eve-central.com/api/marketstat?typeid=44&typeid=3683&typeid=3689&typeid=9832&typeid=9848&typeid=16274&typeid=17889&typeid=17888&typeid=17887&typeid=16273&typeid=16273&typeid=16634&typeid=16643&typeid=16647&typeid=16641&typeid=16640&typeid=16650&typeid=16635&typeid=16648&typeid=16633&typeid=16646&typeid=16651&typeid=16644&typeid=16652&typeid=16639&typeid=16636&typeid=16649&typeid=16653&typeid=16638&typeid=16637&typeid=16642&typeid=16663&typeid=16659&typeid=16660&typeid=16655&typeid=16668&typeid=16656&typeid=16669&typeid=17769&typeid=16665&typeid=16666&typeid=16667&typeid=16662&typeid=17960&typeid=16657&typeid=16658&typeid=16664&typeid=16661&typeid=16654&typeid=17959&typeid=16670&typeid=17317&typeid=16673&typeid=16683&typeid=16679&typeid=16682&typeid=16681&typeid=16680&typeid=16678&typeid=16671&typeid=16672"), HttpWebRequest) Dim ws As HttpWebResponse = CType(wr.GetResponse(), HttpWebResponse) Dim str As Stream = ws.GetResponseStream() Dim inBuf(100000) As Byte Dim bytesToRead As Integer = CInt(inBuf.Length) Dim bytesRead As Integer = 0 While bytesToRead > 0 Dim n As Integer = str.Read(inBuf, bytesRead, bytesToRead) If n = 0 Then Exit While End If bytesRead += n bytesToRead -= n End While Dim fstr As New FileStream("C:\Users\Shawn\data.xml", FileMode.OpenOrCreate, FileAccess.Write) fstr.Write(inBuf, 0, bytesRead) str.Close() fstr.Close()
here is the code to load it to the grid view
Quote: Dim dsData As New DataSet("Data") Dim filepath As String 'filepath = "C:\Users\Shawn\documents\visual studio 10\Projects\Reaction 2.0\Reaction 2.0\XMLFile1.xml" filepath = "C:\Users\Shawn\data.xml" dsData.ReadXml(filepath) dsData.Tables("all").Merge(dsData.Tables("Type")) DataGridView1.DataSource = dsData DataGridView1.DataMember = ("all") DataGridView1.Item(0, 0).Selected = False dsData.Tables("sell").Merge(dsData.Tables("Type")) DataGridView2.DataSource = dsData DataGridView2.DataMember = ("sell") DataGridView2.Item(0, 0).Selected = False dsData.Tables("buy").Merge(dsData.Tables("Type")) DataGridView3.DataSource = dsData DataGridView3.DataMember = ("buy") DataGridView3.Item(0, 0).Selected = False
and here is what i get
Quote: Data at the root level is invalid. Line 2027, position 1.
any ideas killcarebears.net |
nobody knows
|
Posted - 2010.12.23 09:04:00 -
[2]
as i see this correct, the xml is loaded from the web, saved to disc and loaded from disc correctly...
maybe you have done any specific property changes to the DataGridView[1-3]? (cant verify without more code)
XDocument and the DataSet can load the xml so the data is correct. also i have inspected it manual :)
|
Project 69
|
Posted - 2010.12.24 08:16:00 -
[3]
Edited by: Project 69 on 24/12/2010 08:16:42 inlike "POST", "GET" Request have a maximum length of characters, maybe that's the problem it's just one problem I had with my pages recently.
|
shawn313
Gallente
|
Posted - 2010.12.27 05:43:00 -
[4]
i dont under stand the XDocument that why i did not use it. killcarebears.net |
shawn313
Gallente
|
Posted - 2010.12.27 06:11:00 -
[5]
after looking at the xml file their are a fe places that are odd the end of the file look like this
</marketstat> </evec_api> i> /marketstat> </evec_api> > killcarebears.net |
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |