Sorry for the crosspost, but I really am stumped here. (vs2008pro)
The problem is using an XML file as a Datasource in asp.net that was created
in a vb.net winforms app.
Any explination would be much appreciated.
I will try to explain the best way I can with the following example:
Create a vb.net windowsform application and manually add a dataset.
Create 1 table in the dataset (this dataset and table are not connected to a
I created a table called Colors and added the following columns.
Put a datagridview on the windows form and a button.
Bind the datagridview to dataset1 and the bindingsource to the colors table.
Put a commandbutton on the form,
Add this code
Now, run the app and add data to the datagrid, and push the command button.
Now you have an xml file created directly from the dataset with some data.
I went and took the xml file and changed it around a bit and saved it with a
different name: myxmlfile_canBind.xml
===here is the xmlfile changed.
<?xml version="1.0" encoding="utf-8" ?>
<AColor Id="1" Color="Black" ImageUrl="somewhere" />
<AColor Id="2" Color="Red" ImageUrl="somewhereelse" />
Here is a snippet of the original
<?xml version="1.0" standalone="yes"?>
***Take note how the two xmls look different. (the one created by vb.net
writexml and the one created manually)
Now create a brand new asp.net project,
Copy all the xml files created in to the App_Data folder.
Add a dropdown on the aspx page, and an xmldatasource.
The XMLDatasource1 has the properties set as follows:
Bind the dropdown to the xmlDatasource1 - notice how you can pick an ID for
the value and the color for the display.
Now try and bind to the second xml file ( that was actually created through
vb ) by writing an xml with the same step2.
Dont forget to pick a different Xpath. I cannot tell you what it is cause I
cannot get this part working.
Funny how you cannot bind to a valid xmldatasource that was actually created
with the writeXML