Click here to Skip to main content
15,878,959 members
Articles / Productivity Apps and Services / Microsoft Office

Document and Code Generation by LINQ and XSL

Rate me:
Please Sign up or sign in to vote.
3.87/5 (8 votes)
3 Aug 2008CPOL15 min read 31.8K   339   43  
An article on how to generate source code as well as populate Excel Spreadsheets.
Public Module LinqData_2

	Public Function CreateClass(ByVal table As DataTable) As XElement

		Dim xslt = <class_1>
					   <data_1>
using System;

namespace WebbertSolutions
{
	public class WorkAddress
	{
		#region Constants

		#endregion

		#region Data Members
					   </data_1>
					   <data_2>
		private Guid _id;
		private int _street;
		private string _address;
		private string _city;
		private string _state;
					   </data_2>
					   <data_3>
		#endregion

		#region Constructor
					   </data_3>
					   <data_4>
		/// <summary>
		/// Constructor
		/// </summary>
		public WorkAddress()
		{
		}
					   </data_4>
					   <data_5>
		#endregion

		#region Properties
					   </data_5>
					   <data_6>
		/// <summary>
		/// Get/Set for Id
		/// </summary>
		public Guid Id
		{
			get { return (_id); }
			set { _id = value; }
		}

		/// <summary>
		/// Get/Set for Street
		/// </summary>
		public int Street
		{
			get { return (_street); }
			set { _street = value; }
		}

		/// <summary>
		/// Get/Set for Address
		/// </summary>
		public string Address
		{
			get { return (_address); }
			set { _address = value; }
		}

		/// <summary>
		/// Get/Set for City
		/// </summary>
		public string City
		{
			get { return (_city); }
			set { _city = value; }
		}

		/// <summary>
		/// Get/Set for State
		/// </summary>
		public string State
		{
			get { return (_state); }
			set { _state = value; }
		}
					   </data_6>
					   <data_7>
		#endregion

		#region Methods - Public

		#endregion

		#region Methods - Private

		#endregion
	}
}
					   </data_7>
				   </class_1>
		Return xslt

	End Function

End Module

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Webbert Solutions
United States United States
Dave is an independent consultant working in a variety of industries utilizing Microsoft .NET technologies.

Comments and Discussions