C#实现Pivot(Cross Table)的一段代码和例子public static DataTable Pivot(IDataReader dataValues, string keyColumn, string pivotNameColumn, string pivotValueColumn) 
  • dataValues -- this is any open DataReader object, ready to be transformed and pivoted into a DataTable.  As mentioned, it should be fully grouped, aggregated, sorted and ready to go.  要处理的DataReader
  • keyColumn -- This is the column in the DataReader which serves to identify each row.  In the previous example, this would be CustomerID.  Your DataReader's recordset should be grouped and sorted by this column as well. X轴字段
  • pivotNameColumn -- This is the column in the DataReader that contains the values you'd like to transform from rows into columns.   In the example, this would be ProductName. Y轴字段
  • pivotValueColumn -- This is the column that in the DataReader that contains the values to pivot into the appropriate columns.  For our example, it would be Qty, which has been defined in the SELECT statement as SUM(Qty).数据区字段

    例子:
    C#实现Pivot(Cross Table)的一段代码和例子private void Sample()
    C#实现Pivot(Cross Table)的一段代码和例子

    转载自:http://weblogs.sqlteam.com/jeffs/archive/2005/05/11/5101.aspx
  • 相关文章:

    • 2022-12-23
    • 2021-06-20
    • 2021-08-06
    • 2021-04-03
    • 2022-12-23
    • 2022-12-23
    • 2022-12-23
    • 2022-12-23
    猜你喜欢
    • 2021-06-26
    • 2022-01-08
    • 2021-05-30
    • 2022-02-16
    • 2023-01-09
    相关资源
    相似解决方案