Saif Khan

{ I am Saif } "Knowledge is power, information is free, share it!"
posts - 24, comments - 118, trackbacks - 0

My Links

News

Archives

.NET

Hardware

Networking

Wednesday, June 01, 2011

A simple DataSet XSD Viewer

Earlier this week I had a requirement for displaying an XSD DataSet schema in my application to the end-user. I couldn’t find a free or relatively cheap component. All the items I came across were either too bulky (loads of functionality) or pricey. I was also looking for something along the lines of a user-control which I could drop on a form and wire-up. I decided to roll my own…after an hour I came up with this

 

6-2-2011 1-54-55 AM

 

I used Open Diagram engine…pretty much straight forward.

6-2-2011 2-25-04 AM

 

To keep things simple I didn’t mess with the XSD schema via XML. I just loaded the schema into a dataset object and pass it to the control I created

DataSet ds = new DataSet();
ds.ReadXmlSchema("C:\\XSDViewerControl\\DataSet1.xsd");
XsdExplorer1.SetDataSet = ds;
XsdExplorer1.DiaplayDiagram();
 

When I have some time I’ll add a property grid and probably use docking windows…and “Foreign-Key” references on the diagram. This was just a quick solution.

Posted On Wednesday, June 01, 2011 6:39 PM | Feedback (1) |

Powered by: