Create Pivot Table In C#
Step 1 Create Class file as Pivot.cs and copy the below text and save in your file . using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; /// <summary> /// Pivots the data /// </summary> public class Pivot { private DataTable _SourceTable = new DataTable(); private IEnumerable<DataRow> _Source = new List<DataRow>(); public Pivot(DataTable SourceTable) { _SourceTable = SourceTable; _Source = SourceTable.Rows.Cast<DataRow>(); } /// <summary> /// Pivots the DataTable based on provided RowField, DataField, Aggregate Function and ColumnFields.// /// </summary> /// <param name="rowField">The column name of the Source Table which you want to spread into rows</param> /// <param name="dataField">...
Comments
Post a Comment