I have an XML file (data and schema) created programatically from a
DataTable. I need to open this file in VS.NET and view it in the data view
(grid view). When I open the file the first time, this works perfectly well.
However, once I close it (no edits) and try to open again, VS gives an error
as follows:

"Although this XML document is well formed, it contains structure that Data
View cannot display. Column requires a valid Data Type."

The weird thing is that this still happens even when I make the newly
created file read only. It opens in Data View the first time, then it it
fails after that. I don't see how the file could change given that it is
read only.

BTW, all columns are typed. Some are typed as enums we have defined. But if
this was a problem, it seems the file wouldn't open in Data View even once.
It opens fine the first time. I can regenerate the same file, and it again
opens fine the first time it is opened. Also, I set the read only property
immediately (before the file is ever opened.)

Anyone have any ideas what is causing this?

Thanks!