xml schema item not available

T

Terry Brown

I want to use xml to save and restore data for my compact framework
application. So, trying to follow the how-to in the documentation, I
tried to add a new item of type xml schema. However, in the compact
framework, this is not available. I see that it is available in the
standard windows .Net framework.

Since the compact framework can apparently read and interpret schemas, why
is creating a schema within a compact framework project not available? Is
this trying to tell me something???

Thanks,

Terry Brown
Stickman Software
http://www.stickmansoftware.com
 
I

Ilya Tumanov [MS]

I'm not quite sure what exactly you're trying to accomplish.

If you trying to use typed DataSet (which is created from XSD schema file),
it's not supported on CF.
You could use untyped DataSet instead and load schema into it manually
using DataSet.ReadXmlSchema().
That should be done manually as there's no designers support for DataSet.

If you trying to load schema into, say, XmlSchemaCollection class, that is
not supported as this class is not available on CF.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
 
T

Terry Brown

I'm not quite sure what exactly you're trying to accomplish.

If you trying to use typed DataSet (which is created from XSD schema file),
it's not supported on CF.
You could use untyped DataSet instead and load schema into it manually
using DataSet.ReadXmlSchema().
That should be done manually as there's no designers support for DataSet.

If you trying to load schema into, say, XmlSchemaCollection class, that is
not supported as this class is not available on CF.

Best regards,

Ilya

Hmmm . . .

Well, I have some simple data (basketball statistics for players) that I
wish to save and restore from my application. I read about using XML for
this and using a DataSet in Chapter 9 of "The Definitive Guide to the .NET
Compact Framework" I don't see any mention of "typed" vs "untyped" there,
so, not understanding the real issues, I tried to create my schema using
the Designer, but couldn't find the schema type.

There are two issues for me:

1) I am a novice on most of this kind of object-oriented stuff and with
database stuff in particular. and

2) I keep making the mistaken assumption that there are obvious documented
differences between the .NET Framework and the .NET Compact Framework.

#2 is the real problem--I can learn, and overcome #1--but I keep coming up
against the fact that when I read things like "Introduction to Datasets"
from the Visual Studio Help, that it doesn't give me any information about
what is available or not available in Compact Framework. So I merrily go
off trying to figure something out, only to find that it isn't available
to my application environment.

Thanks for the help.

Terry Brown
Stickman Software
http://www.stickmansoftware.com
This posting is provided
"AS IS" with no warranties, and confers no
 
I

Ilya Tumanov [MS]

#1 -That should help with generic understanding of DataSet object:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbcondatasets.asp
#2 - You right, while it is mentioned in many CF articles and books (e.g.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtuv/ht
ml/etcondatabinding.asp), there's no information about that in articles on
generic ADO.Net (as most of them were written before CF). Sorry about that.
Please see this for more information on CF specifics:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtuv/ht
ml/etconcomparisonswithnetframework.asp Here's another good source of
information: http://wiki.opennetcf.org/ow.asp?CompactFrameworkFAQ

Here's quick start which does everything you need:
http://samples.gotdotnet.com/quickstart/CompactFramework/doc/adonetdatabindi
ng.aspx

If you wish to create schema using designers (not infer it from XML),
here's how:

1. Add new item to your project.
2. Select XML as item type.
3. Change the name so it would have XSD extension, i.e. nbastats.xsd
4. Add the line below to the XML you see.

<xs:schema id="DataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"></xs:schema>

Now you can switch to schema view and design your schema. You can load
schema into the untyped DataSet using DataSet.ReadXmlSchema() as described
in quick start above.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
T

Terry Brown

Thanks for all the info and pointers. This helps.

Now I get to write code :)

Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top