473,746 Members | 2,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSD Class Generation

Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #1
13 2682
SevDer

Click right on your mouse on the surface in the IDE where the not XML
presentation of the XSD is located and choose generate dataset.

Cor

"SevDer" <se****@newsgro up.nospamschree f in bericht
news:uP******** ******@TK2MSFTN GP03.phx.gbl...
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #2
xsd.exe (for example, at a VS2005 command prompt)

e.g.

xsd my.xsd /classes /enableDataBindi ng
xsd my.xsd /dataset
xsd /?

Marc

Aug 23 '07 #3
Hi SevDer,

As Cor has suggested, you can use Visual Studio's built-in DataSet
generation feature to generate a typedDataset from a given xsd file.
However, in VS 2005, the supported approach is different from VS 2003(no
"generate dataset" command is available). Here is how to generate the
dataset from an xsd file in 2005:
>>>>>>>>
1. Select the xsd file in the solution explorer
2. At the Property Grid (F4) find the CustomTool property and type
MSDataSetGenera tor
The typed dataset will be generated for you.
<<<<<<<<<

Also, you can use the .net framework sdk's built-in xsd.exe utility to
generate custom classes from a given xsd file in commandline. This tool
support generating both normal classes and DataSet classes:

#XML Schema Definition Tool (Xsd.exe)
http://msdn2.microsoft.com/en-us/lib...0s(VS.71).aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 23 '07 #4
check XSDObjectGen.ms i for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #5
You, Sir, are a genius. I have spent soooo long trying to "fix" the
problem where the designer.cs files weren't being updated when I
edited my datasets. This got to the point where I ended up migrating
new and changed dataadapters to a whole new project. I've just tested
the MSDataSetGenera tor option above, and it works!!! I looked at the
newer projects, and found they have this property set by default,
whereas the old ones did not - hence why they weren't regenerating.

I seriously owe you one - i figured this was a bug or something with
VS, and I've been ignored in the newsgroups when asking about it.
Many, many thanks.

Ship.
On Aug 23, 6:12 am, stch...@online. microsoft.com (Steven Cheng[MSFT])
wrote:
Hi SevDer,

As Cor has suggested, you can use Visual Studio's built-in DataSet
generation feature to generate a typedDataset from a given xsd file.
However, in VS 2005, the supported approach is different from VS 2003(no
"generate dataset" command is available). Here is how to generate the
dataset from an xsd file in 2005:

1. Select the xsd file in the solution explorer
2. At the Property Grid (F4) find the CustomTool property and type
MSDataSetGenera tor
The typed dataset will be generated for you.
<<<<<<<<<

Also, you can use the .net framework sdk's built-in xsd.exe utility to
generate custom classes from a given xsd file in commandline. This tool
support generating both normal classes and DataSet classes:

#XML Schema Definition Tool (Xsd.exe)http://msdn2.microsoft.com/en-us/lib...0s(VS.71).aspx

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Aug 23 '07 #6
Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd files
and as a result when converting, they are unable to find certain types which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gm ail.comwrote in message
news:17******** *************** ***********@mic rosoft.com...
check XSDObjectGen.ms i for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
>Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com
Aug 23 '07 #7
i already worked with xsd with reference (using the XSDObjectGen app), so it
seems very strange.
--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd files
and as a result when converting, they are unable to find certain types which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gm ail.comwrote in message
news:17******** *************** ***********@mic rosoft.com...
check XSDObjectGen.ms i for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com

Aug 23 '07 #8
I managed to work with it by combining included xsd.

Actually the included XSD also includes another one and I think thats where
I fail.

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gm ail.comwrote in message
news:88******** *************** ***********@mic rosoft.com...
>i already worked with xsd with reference (using the XSDObjectGen app), so
it
seems very strange.
--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:
>Hello Yaron,

This is also a great tool.
However I still have the same problem.
The problem I am experiencing is, my xsd files are including other xsd
files
and as a result when converting, they are unable to find certain types
which
are included in the include xsd files.
I think those tools do not work with included xsds

--

Sevket Seyalioglu
CTO
www.kbstours.com
"Yaron Karni" <ya*********@gm ail.comwrote in message
news:17******* *************** ************@mi crosoft.com...
check XSDObjectGen.ms i for .net 1.0 also have a look at :
http://devauthority.com/blogs/ram_ma...0/03/4755.aspx

--
Sincerely
Yaron Karni
http://dotnetbible.blogspot.com/
"SevDer" wrote:

Hi,

Can someone tell me how to generate classes from XSD files?
Is there an easy way to convert it into typed datasets etc?

Or any other suggestion is welcomed.

--

SevDer
http://www.sevder.com

Aug 23 '07 #9
Thanks for your reply and the XSD fragment,

I'll perform some local test to see whether I can get some result. I'll
update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Aug 24 '07 #10

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

Similar topics

8
3719
by: Max M | last post by:
Yesterday there was an article on Slashdot: http://books.slashdot.org/article.pl?sid=03/09/04/1415210&mode=flat&tid=108&tid=126&tid=156 It is about automatic code generation. I got interrested in the subject, did a web search, and it seems kind of powerfull. My main interrest is web development in Zope/CMF/Plone, where there is a lot of repeated code in the products. So automated code generation seems
0
2444
by: Rasmus Fogh | last post by:
Someone raised the question of automatic code generation a few weeks back. And yes, we (CCPN) are using automatic Python code generation in a major way. Basically we are making data models in UML, and using automatic code generation to make Python APIs, XML I/O etc. (more below). We can be found at http://www.ccpn.ac.uk/index.html As a general point, automtic code generation would seem like a good idea in special cases where:
4
2382
by: clintonG | last post by:
I'd like to know about application(s) or the name by which the following process is referred which would allow a business analyst to enter the following statements which when submitted would result in the generation of class library members... "Are you an individual person not working?" if no, ask "have you ever worked for an employer?" if no, ask "Are you thirteen years of age or younger?" ...
16
2170
by: christopher diggins | last post by:
It appears that the following is not considered a class: template<typename T> class C { }; ? So officially is this considered: a class, a template, a class template, or a template class? I always thought of it as a parameterized class. What would the rationale be for not considering it as just a 'class'?
4
10062
by: peter | last post by:
How to create a class dynamicaly at run-time? Some documentations in MSDN say that it is feasible using the class "TypeBuilder",but I don't know how to do. Is there anyone who can help me? Sample code is appreciated.
4
1593
by: Nikolay Petrov | last post by:
I am searching for an idea how to optimize some of my code. Let's say I have a class, which exposes some properties: Class Dummy1 Private m_sValue1 As String Private m_sValue2 As String Public Property Value1() As String Get Value1 = Me.m_sValue1
1
1426
by: Tyler Carver | last post by:
I have created a web reference in a 2005 web project and need to change out the generated complex class with the business oject that we have already created. In a library project there is a code file for the proxy class where I can make the change. However, there is no such file in a Web Project as this class is generated on the fly. So what I need to do is the following: I have a business object Foo. My Webservice has a method...
1
260
by: Mani Jayadevan | last post by:
Sevket, Were you able to resolve the issue? I am facing the same problem. If you have already resolved it please let me know how you did it? Thanks Mani EggHeadCafe - .NET Developer Portal of Choice http://www.eggheadcafe.com
6
4088
beacon
by: beacon | last post by:
Hi everybody, I asked my professor for some practice problems to work on over the summer to prep me for Data Structures this fall and he gave me Conway's Game of Life to recreate. I haven't had any trouble with what I've completed so far, but I want to stop where I'm at and put everything in a class so get some more practice with OOP. Problem is, I've never setup an array class before and I haven't really haven't found any examples online...
13
2678
by: Tony Johansson | last post by:
Hello! I read in a book and here is a question and the answer that I'm not satisfied with. When should you use the StringBuilder class instead of the String class. 1.When building a string from shorter strings. 2.When working with text data longer than 256 bytes. 3.When you want to search and replace the contents of a string 4.When a string is a value type.
0
8975
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9516
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9351
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8229
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6774
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6062
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4840
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2200
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.