I am having trouble using XML in an ASP.NET 2.0 webform. Using ASP.NET 2.0
beta 2, I have created a blank web page in a C# website. I have added an
XML file (soData.xml), structured as follows:
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPData>
<ac_sodata>
<iono>Vendor</iono>
<sodate>2004-03-04</sodate>
<sono>164</sono>
<custno>ADG1</custno>
<item>HD10.0G</item>
<descrip>10.0 GB EIDE Ultra DMA 9.0ms Hard Disk Drive</descrip>
<qtyord>0.000000</qtyord>
<qtyshp>75.000000</qtyshp>
<rqdate>2004-03-04</rqdate>
</ac_sodata>
</VFPData>
When I drag an xmlDataSource from the toolbox to the page in Design mode, I
get the following error dialog box:
The operation could not be completed. Unspecified error.
However, if I drag the xmlDataSource from the toolbar onto the page in
Source mode, there is no error. I am able to go into xmlDataSource Tasks
and configure the data file to ~/soData.xml.
Then when I drag a GridView from the toolbox to the page (in either Design
or Source mode), no error is generated. But when I use the GridView Tasks to
set the data source to xmlDataSource1, the GridView box on the page says:
There was an error rendering the control. The data source for the GridView
with id 'GridView1' did not have any properties or attributes from which to
generate columns. Ensure that your data source has content.
I have generated a schema for the XML file, but that doesn't seem to help.
Here is the layout of the .XSD file:
<?xml version="1.0" encoding="Windows-1252"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="VFPData">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="ac_sodata">
<xs:complexType>
<xs:sequence>
<xs:element name="iono" type="xs:string" />
<xs:element name="sodate" type="xs:date" />
<xs:element name="sono" type="xs:unsignedByte" />
<xs:element name="custno" type="xs:string" />
<xs:element name="item" type="xs:string" />
<xs:element name="descrip" type="xs:string" />
<xs:element name="qtyord" type="xs:decimal" />
<xs:element name="qtyshp" type="xs:decimal" />
<xs:element name="rqdate" type="xs:date" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Any help would be greatly appreciated!
Will Kacy
wi**@kacycreative.com