Generate Class for Smart Form

Create a C# or VB.NET class to programmatically access Smart Form data. Smart Form data is XML and may be processed using XSLT, an XML parser (XmlDocument), Linq/XQuery or even as a string. It may also be deserialized into a .NET object given a C# or VB.NETclass.

This article describes how to generate a class from a Smart Form design.

B. Open a Visual Studio command prompt or a command prompt with xsd.exe in its path. xsd.exe is provided with Visual Studio (C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\xsd.exe) or may be downloaded with the .Net Framework 2.0 SDK from Microsoft's site. For documentation on the options, see XML Schema Definition Tool (Xsd.exe) .

The xsd.exe creates a file with the same name as the schema, for example, bookstore.cs or bookstore.vb.

Example C# class snippet,

//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------