Groups | Blog | Home
all groups > asp.net > march 2005 >

asp.net : Using an XML file as a data source to <asp: controls



AnandaSim
3/6/2005 10:28:01 PM
Hi All,

I'd like to use a static XML file as a source of data to any of the
<asp: list controls.

I have produced the .xml file, inferred a schema - .xsd, generated a
dataset .vb. How do I complete the process and use the dataset in a
vb.net asp.net file? I've been having a peek at the code that VS 2003
generates for creating an ADO.NET but there but am so far none the
wiser.

Or do I just have to stream read the xml file and fill list controls
that way?

Thanks

Ananda
Kostadin Kostov
3/7/2005 2:31:02 AM
If you have filled the dataset properly, just set the datasource of your list
control:
myListControl.DataSource = myDataSet;
myListControl.DataBind();

Rgs,
Kostadin Kostov

[quoted text, click to view]
AnandaSim
3/7/2005 3:07:08 PM
Yes, that is what I want to achieve, but how does main.aspx refer to
and load mydata.xml? I can see that the mydata.vb (generated from
mydata.xsd which in turn is generated from mydata.xml) has routines but
how does main.aspx know to call those routines?
AddThis Social Bookmark Button