I have a bunch of .xsd files some of which inherit from others, such that
there are elements that have attributes in one file and also inherts other
attributes from another file. These schemas come from an external source (I
have no control over them). We plan to store the .xml documents as they come
in (using Oracle XML DB), then read them in, validate and manipulate them in
Visual Studio (2005 beta due to a bug in 2003 that the schemas abuse).

I want to create a strongly typed dataset, so that when I read the document
in I can reference it using the tables and columns in the dataset. How do I
go about creating this dataset from the (20+) schemas?

Re: Schema Collection -> Strongly Typed Dataset by Sahil

Sahil
Mon Apr 04 13:35:19 CDT 2005

Vicki,

Not every XSD schema qualifies to be a dataset. Are your schemas dataset
friendly? You can use the XmlSchemas.IsDataSet method to find out.

- Sahil Malik [MVP]
http://codebetter.com/blogs/sahil.malik/





"Vicki" <vmv_cec@community.nospam> wrote in message
news:79DC9868-7164-4626-88E0-404DCA2D67D3@microsoft.com...
> I have a bunch of .xsd files some of which inherit from others, such that
> there are elements that have attributes in one file and also inherts other
> attributes from another file. These schemas come from an external source
(I
> have no control over them). We plan to store the .xml documents as they
come
> in (using Oracle XML DB), then read them in, validate and manipulate them
in
> Visual Studio (2005 beta due to a bug in 2003 that the schemas abuse).
>
> I want to create a strongly typed dataset, so that when I read the
document
> in I can reference it using the tables and columns in the dataset. How do
I
> go about creating this dataset from the (20+) schemas?



Re: Schema Collection -> Strongly Typed Dataset by v-kevy

v-kevy
Mon Apr 04 21:02:24 CDT 2005

Hi Vicki,

I agree with Sahil, that the xsd schema must be qualifies to be a DataSet
schema. Also, as far as I know, there is no elegant way to load the schema
from several xsd files. The only way I can see, is to combine them with
XSLT, and then load to a DataSet using DataSet.ReadXmlSchema. HTH.

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


Re: Schema Collection -> Strongly Typed Dataset by vmv_cec

vmv_cec
Tue Apr 05 08:53:02 CDT 2005

Maybe my question is a 2005 Beta IDE question after all. I loaded all of the
xsd files into a test project, then went to the lowest level xsd (the one
that inherits from all of the others), and was able to preview the dataset
and it looks fine, I see all the attributes. I told it to generate the
dataset, and after saving all, when I go to the object browser, I expected to
see a new class in my project that inherits from dataset and contains
datatables for the elements in the schema. But I do not see this or anything
close in the object browser.

So it seems that my schema is in fact qualified to be a dataset, although I
have not yet tried the tricks you and Sahil mention. My goal is to be able
to write code to manipulate the XML document using the strongly typed
dataset, but I have not yet convinced myself that I have successfully
generated it, as I can not view it in Visual Studio.

Is there something I am missing?

"Kevin Yu [MSFT]" wrote:

> Hi Vicki,
>
> I agree with Sahil, that the xsd schema must be qualifies to be a DataSet
> schema. Also, as far as I know, there is no elegant way to load the schema
> from several xsd files. The only way I can see, is to combine them with
> XSLT, and then load to a DataSet using DataSet.ReadXmlSchema. HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

Re: Schema Collection -> Strongly Typed Dataset by v-kevy

v-kevy
Thu Apr 07 02:34:04 CDT 2005

Hi Vicki,

Since the schemas are loaded and the class for the typed dataset cannot be
generated, I assume that the schema files are not qualified for a DataSet
Schema. Because Visual Studio .NET 2005 is a beta version, besides posting
here, you can also try posting in the following newsgroup. It is dedicated
for VS.NET 2005 questions.

http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&amp;slci
d=us

HTH.

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


Re: Schema Collection -> Strongly Typed Dataset by vmv_cec

vmv_cec
Thu Apr 07 13:11:03 CDT 2005

Thanks Kevin,

I did in fact find that the way to generate a Strongly typed dataset from a
schema in 2005 is different, and was finally successful in doing so. I think
there is a bug in the MSDataSetGenerator tool, but I found a way to work
around it and I will report it there. Thanks for the link.

Vicki

"Kevin Yu [MSFT]" wrote:

> Hi Vicki,
>
> Since the schemas are loaded and the class for the typed dataset cannot be
> generated, I assume that the schema files are not qualified for a DataSet
> Schema. Because Visual Studio .NET 2005 is a beta version, besides posting
> here, you can also try posting in the following newsgroup. It is dedicated
> for VS.NET 2005 questions.
>
> http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slci
> d=us
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>

Re: Schema Collection -> Strongly Typed Dataset by v-kevy

v-kevy
Thu Apr 07 22:27:19 CDT 2005

You're welcome, Vicki. Thanks for give feedback to our product.

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