Question

Is there a utility out there that will create VB.NET classes from a Dataset.xsd file? And I don't mean like the XSD.exe utility does - all that does is convert the XML of an XSD file into classes in a .vb - it doesn't append any "extended" functionality.

I'm basically looking for something that will generate the beginnings of a business layer from the XSD file. Like creating a partial class for each datatable, then create a property for each of the datatable's columns as the right datatype and finally the basically CRUD methods as well.

This is something I have to do manually over and over again for each project. (I do lots of little projects and use VistaDB so I can't use Linq-To-SQL - wish I could)

Was it helpful?

Solution

I know this doesn't strictly answer the question, but it looks like VistaDB either does, or will soon, have a provider that can be used with Linq to Entities - see here

OTHER TIPS

I think that xsd.exe will do what you need it to. Here's and example to convert purchaseorder.xsd to a vb class in the Purchasing namespace:

xsd.exe -c -l:vb -n:Purchasing purchaseorder.xsd

Type xsd.exe /? from a visual studio command prompt to get all of the options.

You can find more info here.

Try taking a look at T4 and Code Generation tools in Visual Studio. It's like "writing code that writes code", and it's incredibly powerful.

A great video, really an "aha experience" for me http://www.pnpguidance.net/Screencast/T4TemplatesVisualStudioCodeGenerationScreencast.aspx

MSDN: http://msdn.microsoft.com/en-us/library/bb126445.aspx

Rob Conery has written an intro: http://blog.wekeroad.com/blog/make-visual-studio-generate-your-repository/

... and so did Scott Hanselman: http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx

I understand it's probably not exactly what you're hoping for, but when you want more flexibility and NOT having to write the same code over and over again, it really sounds like T4 could be a solution.

You'll write a template, that analyses your XSD file and generates the vb files directly in your project.

Liquid studio XML Data Binder looks like it does what you want and has a 30 day trial you can download.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top