DataSet Designer, Schema Designer and Xml Editor


DataSet Designer, Xml Schema Designer and Xml Editor


(Note, DataSet Designer is also called DataSet Editor, Xml Schema Designer is also called Xml Schema Editor)


In VS2002 or 2003, we shipped a XmlSchema designer, which serves as both schema designer and typed dataset designer.


In VS2005, you will see that there is a brand new DataSet designer in additional to the original Xml Schema designer.


Furthermore, there is a new xml text editor (developed by Chris Lovett from another team, I am sure someone is blogging it, will find out where) called Xml Editor will be shipped too.


What are the relationships among these designers?


All of them have the same extension “.xsd”


If you start fresh, create a new DataSet item, the DataSet designer will be launched.


If you choose to create a new Xml Schema item, the XmlSchema designer will be launched.


If you double click (or open) on an existing xsd file in the solution explorer (SE), the IDE is smart to peek the content of the file and open the DataSet designer or SchemaDesigner appropriately. The DataSet file is recognized by the msdata:IsDataSet=”true” attribute in the root element of the schema, for example:


<xs:element name=”DataSet1″ msdata:IsDataSet=”true”…>


Well, you know that the DataSet is a schema file, so you can still open it by the Schema Designer, you can do this by open with menu (see the picture).


Can we open a non-DataSet xsd file with DataSet designer? Sure you can but you will be warned that to use with your own risk because the DataSet designer use DataSet.WriteSchema to persist the data. That means it does not persist white space, comment, etc.


Another cool thing is the XmlText editor and the DataSet designer shares same designer architecture and they share the same text buffer. That said, you can open an xsd file with both designer at the same time, changing in DataSet designer will reflect to XmlEdit immediately and vise versa.


To be continued…


Ok, pick it up from yesterday.


What about the sharing buffer with Xml Schema Editor? Well, that depends on which editor is opened first.


If you open the xsd file with DataSet designer first(which uses text-buffer), then open with Xml Schema Editor, you are in good luck as XML Schema Designer knows how to use text-buffer. However, if you open the file by XML Schema Designer first (which uses HtmDocData buffer), then bad luck, you cannot open it in DataSet designer as it does not know how to use HtmDocData buffer. The IDE will prompt you to close the Xml Schema Designer in order to open the DataSet designer.


When you right click on the xsd file, you can also see there is a menu command called View Code (of course there is a View Designer command, and you should know that it will launch either DataSet designer or Xml Schema Designer as I talked above). What is the View Code doing here?


Here is a summary: if the DataSet designer is opened, view code will bring you to the partial class file (e.g. DataSet1.vb). If DataSet designer is not opened or the Schema designer is opened, view code will bring you to the xsd source code with the Xml Editor.


There is an exception though for the web project. As a web project does not support the partial class, the view code command then always brings you to the xsd source code even the DataSet designer is opened first.


Wrap it up here! I hope this blog make you feel clear about how our DataSet designer works along the Xml Schema Designer and Xml (Text) Editor.


I hope we can have a new extension for typed dataset file next version.


(Don’t know how to add a picture yet. See my post here for the pictures for now).


Zhiyong (John Chen)

Comments (32)

  1. MDeevi says:

    The DataAdaptor in Beta 1 had a generate WebMethod property. In Beta 2 this property isn’t there. I want to know how to web-enable the dataset and update data across the web using the DataSet designer rather than hand coding it, the way I could use the generateWebMethod property.

    Please let us know whether this feature will be available in VS2005 RTM product.

  2. Steve Lasker says:

    Hi MDeevi,

    This was removed in Beta 2 as we took the DataSet generated code on a diet. It’s not that we don’t think the scenario was important, we just didn’t have the time to complete the scenario and make sure it would work as expected. This is something we’re looking at post whidbey. I posted a blog describing the B1 to B2 changes on our old blog site: http://blogs.msdn.com/vbteam/archive/2005/01/12/351495.aspx

    Hope this helps,

    Steve

  3. Stan Kitsis says:

    I’ve got a few blogs about the new XML Editor. http://blogs.msdn.com/stan_kitsis

  4. CarlMeis says:

    The fact that xsd documents CANNOT be opened with Xml Dada Editor is a problem for stand alone DataSets that have both the schema and the data together. So we are forced to create two files an .xsd for the schema and an .xml for the instance.

    Because they are NOT together when manually editing the instance file with either XmlData editor or XML editor IT IS NOT VALIDATED against the schema real time.

    Likewise if you change the schema the xml instance needs looking over ALL MANUALLY.

    All these editors that don’t really talk to each other is a very BRITTLE MODEL.

  5. ELIA says:

    I just saw this – X-Pubs 2006, Europe’s largest XML content management and publishing conference. Looks like they have Ann Rockley and JoAnn Hackos, plus Adobe, Mark Logic, XMetal, Idiom etc.

    Its on 20-21st June in London

    Have a look

    http://www.x-pubs.com

    <a href="http://www.x-pubs.com">XML Content management conference</a>

  6. Rajiv says:

    Hi,

    I know you’ve done a lot of cool things in VS-2005 re datasets, however I need to migrate from VS-2003 and want to know how I can create a dataset from an xml file.

    In VS-2003, I could add an xml file to the project, then rt click and say generate schema. In the schema (.xsd) file I could again rt click and say Generate Dataset.

    I don’t see a genereate dataset option in the schema xsd file in VS-2005.

    Has this option been moved some place else that I might be missing.

    Any help on this would be really appreciated as this is currently preventing me from adapting VS-2005 for production purposes.

    Thanks

    -Rajiv

    Web / Databse Admin

    rgadkari@schwablearning.org

  7. Rajiv says:

    Hi,

    I know you’ve done a lot of cool things in VS-2005 re datasets, however I need to migrate from VS-2003 and want to know how I can create a dataset from an xml file.

    In VS-2003, I could add an xml file to the project, then rt click and say generate schema. In the schema (.xsd) file I could again rt click and say Generate Dataset.

    I don’t see a genereate dataset option in the schema xsd file in VS-2005.

    Has this option been moved some place else that I might be missing.

    Any help on this would be really appreciated as this is currently preventing me from adapting VS-2005 for production purposes.

    Thanks

    -Rajiv

    Web / Databse Admin

    rgadkari@schwablearning.org

  8. Michael Paterson says:

    In the tutorial that I’m watching (created by LearnVisualStudio.Net) they Generate a DataSet.  This creates a code-behind file for the .xsd file write code for handling events.  How can I add this file if I can’t generate the dataset (the option is not available under Schema)?

    Thanks,

    Michael

  9. greg,greg says:

    You should also know there is something you can do about it. Millions of these men have already improved their sex lives with ProCalisX. <a href= http://procalisx.myforum.ro >use of ginkgo biloba</a><br> [url=http://procalisx.myforum.ro]use of ginkgo biloba[/url]<br>

  10. ... says:

    Lavoro eccellente! ..ringraziamenti per le informazioni..realmente lo apprezzo: D

  11. ... says:

    The information I found here was rather helpful. Thank you for this.

  12. ... says:

    luogo interessante, soddisfare interessante, buon!

  13. ... says:

    Luogo molto buon:) Buona fortuna!

  14. ... says:

    E evidente che il luogo e stato fatto dalla persona che realmente conosce il mestiere!

  15. ... says:

    luogo interessante, soddisfare interessante, buon!

  16. ... says:

    Lo trovo piuttosto impressionante. Lavoro grande fatto..)

  17. Have you seen <a href=”http://www.x-pubs.com">www.x-pubs.com</a&gt;? It’s a great XML Content Management and XML Publishing conference which I think is relevant.  2006 was brilliant and 2007 is looking even better!

    Michael Priestly (lead DITA Architecture Architect), Scott Abel, Steve Manning from the Rockley Group, PTC Arbortext, Adobe and many others are presenting real-life case studies.

    If you’re looking for a good <a href=”http://www.x-pubs.com>XML conference</a>, X-Pubs is Europe’s largest.  Also if you buy early you can get in cheaper.

  18. Have you seen http://www.x-pubs.com ? It’s a great XML Content Management and XML Publishing conference which I think is relevant.  2006 was brilliant and 2007 is looking even better!

    Michael Priestly (lead DITA Architecture Architect), Scott Abel, Steve Manning from the Rockley Group, PTC Arbortext, Adobe and many others are presenting real-life case studies.

  19. Britneyztpce says:

    Very nice! I have some LJ with news, check this out:

    <a href= http://iwantubadlyz.livejournal.com >Newest news</a>

    <a href= http://annakubat.livejournal.com >Check this out</a>

    <a href= http://jackie_simpson.livejournal.com >livejournal</a>

  20. Britneymvkjw says:

    Very nice! I have some LJ with news, check this out:

    <a href= http://michelas.livejournal.com >My live journal</a>

    <a href= http://homerius.livejournal.com >Lastest news</a>

    <a href= http://johnyknoxw.livejournal.com >My live journal</a>

  21. Wried says:

    Very nice! I have some sites with news, check this out:

    <a href= http://kreolikko.livejournal.com >Politics news</a>

    <a href= http://icefroggg.livejournal.com >Lastest news</a>

    <a href= http://icyiceman.livejournal.com >Lifestyle news</a>

  22. Britneyomvbo says:

    <a href= http://www.angelfire.com/poetry/nagihi >a pound of flesh</a> <a href= http://www.angelfire.com/funky/xeludy >a map of irving texas</a> <a href= http://www.angelfire.com/planet/wasywa >aa world services</a> <a href= http://www.angelfire.com/planet/sugare >a286 stainless steel</a> <a href= http://www.angelfire.com/crazy/mumeni >aaa movie ticket</a>

  23. aarst says:

    higuys!What yourblog powered by?

  24. billie says:

    Anyone know of any good tutorials for the visual studio 2k3 dataset designer?

  25. asif says:

    The Schema Designer in Visual Studio 2005 isn’t working properly…

    When i click on .xsd file in solution explorer a download begins and an instance gets created automatically..

    I can see only .xsd files tree view…