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="Windo ws-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.00000 0</qtyord>
<qtyshp>75.0000 00</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="Windo ws-1252"?>
<xs:schema attributeFormDe fault="unqualif ied" elementFormDefa ult="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="VFPData">
<xs:complexType >
<xs:sequence>
<xs:element maxOccurs="unbo unded" 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:unsign edByte" />
<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:decima l" />
<xs:element name="qtyshp" type="xs:decima l" />
<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**@kacycreati ve.com