473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dataset Schema from XSD

MR
Is there a way to load an XML schema into a dataset from a resource or other
object? I am using ReadXmlSchema(filename) and that works fine.
However, I have many XSD files that I would rather not have to distribute
with the application.
I would like to be able to use a typed dataset since the schema is defined
in advance.
Is this possible?
thanks
Nov 17 '05 #1
3 5608
Yes this is possible.

You can compile them at runtime and then make your application smart enough
that it doesn't recompile the same XSD twice.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"MR" <co******@newsgroup.nospam> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
Is there a way to load an XML schema into a dataset from a resource or
other object? I am using ReadXmlSchema(filename) and that works fine.
However, I have many XSD files that I would rather not have to distribute
with the application.
I would like to be able to use a typed dataset since the schema is defined
in advance.
Is this possible?
thanks

Nov 17 '05 #2
Thanks for Sahil's good suggestion.

Hi MR,

For typed DataSEt, of course they can be precompiled into assembly, we can
create TypedDataSet through a XSD in VS.NET and after compiled the
typeddataset's class will exisitng in the output assembly.
Also, if you think using un-typed dataset and load schema dynamically is
ok, we can embed the schema's xml file into our application's resources
(embeded in the assembly). then, the
System.Reflection.Assembly.GetManifestResourceStre am method can help us
retrieve embeded file stream from assemlby's resource collection:

#Assembly.GetManifestResourceStream Method
http://msdn.microsoft.com/library/en...ReflectionAsse
mblyClassGetManifestResourceStreamTopic.asp?frame= true

Hope also helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Sahil Malik [MVP]" <co*****************@nospam.com>
| References: <up**************@TK2MSFTNGP10.phx.gbl>
| Subject: Re: Dataset Schema from XSD
| Date: Sun, 7 Aug 2005 01:06:36 -0400
| Lines: 25
| Organization: dotnetawaremonkey
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| Message-ID: <uk*************@TK2MSFTNGP15.phx.gbl>
| Newsgroups:
microsoft.public.data.ado,microsoft.public.dotnet. framework.adonet,microsoft
..public.dotnet.languages.csharp
| NNTP-Posting-Host: pool-138-88-231-157.res.east.verizon.net 138.88.231.157
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.adonet:33582
microsoft.public.dotnet.languages.csharp:114723
microsoft.public.data.ado:6667
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Yes this is possible.
|
| You can compile them at runtime and then make your application smart
enough
| that it doesn't recompile the same XSD twice.
|
| - Sahil Malik [MVP]
| ADO.NET 2.0 book -
| http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
|
----------------------------------------------------------------------------
|
|
|
| "MR" <co******@newsgroup.nospam> wrote in message
| news:up**************@TK2MSFTNGP10.phx.gbl...
| > Is there a way to load an XML schema into a dataset from a resource or
| > other object? I am using ReadXmlSchema(filename) and that works fine.
| > However, I have many XSD files that I would rather not have to
distribute
| > with the application.
| > I would like to be able to use a typed dataset since the schema is
defined
| > in advance.
| > Is this possible?
| > thanks
| >
|
|
|

Nov 17 '05 #3
Hi MR,

Have you had a chance to lookup the suggestions in the former messages or
have you got any further ideas on this issue? If there're anything else we
can help, please feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 108746306
| References: <up**************@TK2MSFTNGP10.phx.gbl>
<uk*************@TK2MSFTNGP15.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 08 Aug 2005 07:24:36 GMT
| Subject: Re: Dataset Schema from XSD
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| Message-ID: <tM**************@TK2MSFTNGXA01.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Lines: 73
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.csharp:114857
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Thanks for Sahil's good suggestion.
|
| Hi MR,
|
| For typed DataSEt, of course they can be precompiled into assembly, we
can
| create TypedDataSet through a XSD in VS.NET and after compiled the
| typeddataset's class will exisitng in the output assembly.
| Also, if you think using un-typed dataset and load schema dynamically is
| ok, we can embed the schema's xml file into our application's resources
| (embeded in the assembly). then, the
| System.Reflection.Assembly.GetManifestResourceStre am method can help us
| retrieve embeded file stream from assemlby's resource collection:
|
| #Assembly.GetManifestResourceStream Method
|
http://msdn.microsoft.com/library/en...ReflectionAsse
| mblyClassGetManifestResourceStreamTopic.asp?frame= true
|
| Hope also helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
| --------------------
| | From: "Sahil Malik [MVP]" <co*****************@nospam.com>
| | References: <up**************@TK2MSFTNGP10.phx.gbl>
| | Subject: Re: Dataset Schema from XSD
| | Date: Sun, 7 Aug 2005 01:06:36 -0400
| | Lines: 25
| | Organization: dotnetawaremonkey
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | X-RFC2646: Format=Flowed; Response
| | Message-ID: <uk*************@TK2MSFTNGP15.phx.gbl>
| | Newsgroups:
|
microsoft.public.data.ado,microsoft.public.dotnet. framework.adonet,microsoft
| .public.dotnet.languages.csharp
| | NNTP-Posting-Host: pool-138-88-231-157.res.east.verizon.net
138.88.231.157
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.adonet:33582
| microsoft.public.dotnet.languages.csharp:114723
| microsoft.public.data.ado:6667
| | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| |
| | Yes this is possible.
| |
| | You can compile them at runtime and then make your application smart
| enough
| | that it doesn't recompile the same XSD twice.
| |
| | - Sahil Malik [MVP]
| | ADO.NET 2.0 book -
| | http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
| |
|
----------------------------------------------------------------------------
| |
| |
| |
| | "MR" <co******@newsgroup.nospam> wrote in message
| | news:up**************@TK2MSFTNGP10.phx.gbl...
| | > Is there a way to load an XML schema into a dataset from a resource
or
| | > other object? I am using ReadXmlSchema(filename) and that works fine.
| | > However, I have many XSD files that I would rather not have to
| distribute
| | > with the application.
| | > I would like to be able to use a typed dataset since the schema is
| defined
| | > in advance.
| | > Is this possible?
| | > thanks
| | >
| |
| |
| |
|
|

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: harry | last post by:
Hello, not certain if this should go here or ado.net but I'm trying to create an XSD on the fly (due to the fact that our dataaccess component is a legacy component which returns data in an...
3
by: Joe98765 | last post by:
I have data coming from SQL Server and need to write out some XML. I have a schema(xsd) for this XML file. Right now I am bringing in the DataSet and writing out the elements and attributes myself...
0
by: Patrick Kearney | last post by:
Hi All, I have seen this type of question raised in various groups but no one has supplied a definitive answer. I am trying to load a dataset schema that has an xs:include. Project policy is to...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
4
by: Sindarian | last post by:
This just seems like the most basic thing, but I can't find a simple description of this process anywhere and in here, everone is talking about going the other way :( I had .NET create an XML...
0
by: c.w.browne | last post by:
Hi, Ive had a bit of a look around for other people with this problem and cant find anything that solves it in my case, so I'm afraid im going to have to bother you all with a post of my own. ...
1
by: Mac | last post by:
I'm trying to validate input from an xml source to a dataset in dotnet2.0. As far as I can see, type errors correctly cause an exception, but values that are the correct type but do not satisify...
13
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
2
by: Henrik | last post by:
Hi, I'm really stuck with this one. I have a dataset with two tables. One table is company data, and the other is contacts. I populate these by using a SP in SQL Server which returns the two...
0
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.