|
xxx
Yahoo Store Viewer
by Charles Carroll with Ronda Kay Pederson
The code below can read any Yahoo
store if XML export is turned on. This data was obtained from:
http://store.yahoo.com/animalslippers/objinfo.xml but any Yahoo store file can
be used for example:
This little simple utility makes it
easy for a human to look at the complex XML files that Yahoo exports as rows and
columns.
More information: our ongoing
Yahoo store programming with ASP.net continues, you can find out more by
joining our
ASP.net Yahoo stores list.
filename=/experiments/yahoostores/yahoostoreviewer.aspx
<%@ Outputcache duration="6000" VaryByParam="whichdataview"%>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<html>
<script language="VB" runat="server">
SUB Page_Load(Src As Object, E As EventArgs)
Dim ds As New DataSet
dim tablecount as integer
dim tablecurrent as integer
DIM datafromURL as string
Dim FS As New FileStream(Server.MapPath("/experiments/data/animalslippers.xml"), FileMode.Open)
ds.ReadXml(FS)
If ispostback=false THEN
dim counter as integer
tablecount=ds.tables.count()
FOR counter=0 TO tablecount-1
whichdataview.items.add (counter)
NEXT
tablecurrent=8
whichdataview.selecteditem.text=8
ELSE
tablecurrent=cint(whichdataview.selecteditem.text())
END IF
MyDataGrid.DataSource = new DataView(ds.Tables(tablecurrent))
MyDataGrid.DataBind()
FS.close()
END SUB
</script>
<body>
<h3>Yahoo Store Viewer</h3>
<form runat="server" >
<asp:dropdownlist id="whichdataview" runat="server"/>
<asp:Button text="Show Different Store Table" runat="server" />
<br>
<ASP:DataGrid id="MyDataGrid" runat="server"
BackColor="white"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="Verdana"
Font-Size="8pt"
Headerstyle-BackColor="lightblue"
Headerstyle-Font-Size="10pt"
Headerstyle-Font-Style="bold"
/>
</form>
</body>
</html>
|