Matt
Matt

Reputation: 26971

Sending a DataTable's content in an html email, what is the preferred way to generate HTML from a DataTable?

Sending a DataTable's content in an html email, what is the preferred way to generate HTML from a DataTable?

Upvotes: 4

Views: 2777

Answers (2)

Thomas Levesque
Thomas Levesque

Reputation: 292465

You could either :

  • manually generate an HTML table by looping through the table data
  • serialize the DataTable to XML (WriteXml method), and perform an XSL transform on the XML to generate HTML

Upvotes: 2

Axl
Axl

Reputation: 8502

Bind to GridView or DataGrid and use the RenderControl method.

http://blogs.x2line.com/al/articles/859.aspx

Upvotes: 4

Related Questions