471,049 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,049 software developers and data experts.

ASP.NET 2.0: problem using xmlDataSource and GridView...

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"?>
<descrip>10.0 GB EIDE Ultra DMA 9.0ms Hard Disk Drive</descrip>
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"
<xs:element name="VFPData">
<xs:element maxOccurs="unbounded" name="ac_sodata">
<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" />
Any help would be greatly appreciated!

Will Kacy
Nov 12 '05 #1
1 11595

I've experienced the same problem and do not know the answer. However,
I've found a couple of workarounds.

Your XML-file contains textnodes and if you change your XML file format
and use attributes instead, it works.


<user name="Peter" address="City"></user>

instead of


If you don't want to change the XML-file you can make it work if you
write code instead of using the XmlDataSource control:

System.String xmlFile = get_Server().MapPath("XMLfile.xml");
System.Data.DataSet ds_myusers = new

It doesn't answer your question though. I believe it's a bug.

SteenNielsen's Profile: http://www.hightechtalks.com/m80
View this thread: http://www.hightechtalks.com/t2251064

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kurt Kubein | last post: by
2 posts views Thread by Zulander | last post: by
2 posts views Thread by sck10 | last post: by
5 posts views Thread by Mukesh | last post: by
5 posts views Thread by ky0t3 | last post: by
2 posts views Thread by mazdotnet | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.