I have in my winform application 4 datasets that gets values from my database. Values like like how many products I have in my product table and information about categories. I was wondering how I can save the dataset informaiton in a html page. I want to create a html template so that I can present the information in nice way. How can I do that? Eny good guide that explains how to do that?
This seems like a great job for something like RazorEngine. You can define a template using Razor syntax, and then render out the content using the RazorEngine template service, e.g.:
@helper RenderItem(Item item) {
<tr>
<td>item.Name</td>
<td>item.Price</td>
</tr>
}
<html>
<head></head>
<body>
<table>
@foreach (Item item in Model.Items) {
@RenderItem(item)
}
</table>
</body>
</html>
You can save DataSet as XML
and then transform it by using XSLT
.
You can take a look at this samples:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With