William
Fri Apr 23 09:19:26 CDT 2004
QuiQ:
"QuiQ quiq via .NET 247" <anonymous@dotnet247.com> wrote in message
news:uSPOzRTKEHA.2380@TK2MSFTNGP09.phx.gbl...
Hello,
I'm a .net (CF) newbie, and I have the followong problem:
I try to create an application in .NET CF using data stored in XML/XSD
files for an iPAQ.
When I load an XSD file into a dataset i want to create an epmty table which
structure was described in the xsd file.
<<I'm not sure how you are doing this, but you definitely don't have to do
anything fancy.>>
The only solution I have found is to load a "dummy" xml file with at least
one record that match the table's structure and then call the "Clear"
method for the table, but it's not very comfortable...
<<I"m not sure what method that's using but it sounds awkward. What are you
using to load the XSD? Note that Strongly Typed Datasets as they are known
in the full framework don't exist in the cf yet, but that doesn't really
limit you too much. First, create the .xsd file in VS.NET
Next create a file reference to it:
fileXSD = "\program files\YourProgram\NameMatchingXMLFile.xsd"
Next create a stream and read in the .xsd
Dim xsdStrreamReader As New FileStream(fileXSD, FileMode.Open)
Dim xmlSchemaReader as New XmlTextReader(xsdStreamReader)
now just use your dataset and readXMLSchema
myDataSet.ReadXmlSchema(xmlSchemaReader)
Other than the obvios file open io try catch stuff and closing the streams,
that'll get you your schema.
Let me know if you have any problems.
Bill
thanks for any replies in advance
-----------------------
Posted by a user from .NET 247 (
http://www.dotnet247.com/)
<Id>SjnJkud1qECcBYOns4JUbQ==</Id>