Click here to Skip to main content
15,879,184 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 TestData

	Public Function MyDataTable() As DataTable
		Dim dt As DataTable

		dt = New DataTable()
		dt.TableName = "WorkAddress"

		dt.Columns.Add("name")
		dt.Columns.Add("type")

		Dim r As DataRow

		r = dt.NewRow()
		r(0) = "id"
		r(1) = "uniqueidentifier"
		dt.Rows.Add(r)

		r = dt.NewRow()
		r(0) = "street"
		r(1) = "smallint"
		dt.Rows.Add(r)

		r = dt.NewRow()
		r(0) = "address"
		r(1) = "varchar"
		dt.Rows.Add(r)

		r = dt.NewRow()
		r(0) = "city"
		r(1) = "varchar"
		dt.Rows.Add(r)

		r = dt.NewRow()
		r(0) = "state"
		r(1) = "varchar"
		dt.Rows.Add(r)

		Return dt
	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