C# DataTable to a HTML Table Below is C# function to generate HTML table string from DataTable with custom options like Custom headers and Selected fields. “Format” in parameters will contain comma separated values like column1=column 1 name, column2=column 2 name and so on. public static string DataTableToHtmlTable(DataTable TableData, string Format) { try { Dictionary<string, […]
Formatting ASP.net GridView BoundField For Date and Time DataFormatString="{0:d-MMM-yyyy}" For Decimals DataFormatString="{0:F2}" For Currency DataFormatString="{0:C2}" For Percentage DataFormatString="{0:P2}"