Ken,
You can create a schema at load time using inference to determine your
types - I've not done it though and its not intuitive. The schema
over-rides inference as inference is pretty much guess work on the part of
the reader.
http://msdn.microsoft.com/library/de...urefromxml.asp
Your best bet is create a schema if the data columns are fixed at read time
and rewrite the XML with an inline schema and provide that to your consumer.
These links provide some good examples but you'll need to pick them apart...
http://msdn.microsoft.com/library/de...setfromxml.asp http://msdn.microsoft.com/library/de...ionfromxml.asp
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"Ken Cox [Microsoft MVP]" <BA************@sympatico.ca> wrote in message
news:u5**************@TK2MSFTNGP15.phx.gbl...
Hi,
I'm using a dataset to read data from an XML file. I don't control the
XML. The XML has no schema and therefore is treated like a string. My data
consumer wants the column type to be a Double.
Is there a simple way to change a column from string to double? When I try
to do it, the compiler complaints that I can't change the type after the
data is loaded. Maybe there's a way to do a mapping or alias? Can I create
my own schema and apply it after the data is loaded?
Thanks,
Ken