Pivot data not from SQL Server 2005Posted: July 1, 2008
It is a happy journey to work the new functions in SQL Server 2005. I have played quite a lit with pivot functions in both static and dynamic ways. But the right place for doing this pivot should be in the application.
Jeff presented a good example in his blog:http://weblogs.sqlteam.com/jeffs/archive/2005/05/11/5101.aspx
with a customized PIVOT function: http://weblogs.sqlteam.com/jeffs/articles/5091.aspx
A simple test with GridView and SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" SelectCommand="SELECT [RecordNo], [SessionNo], [FluencyNo], [FluencyScore] FROM [pivotData3$]" DataSourceMode="DataReader"> </asp:SqlDataSource> <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="true"></asp:GridView>
void Page_Load(object sender, EventArgs e)
GridView2.DataSource =PivotFront.Pivot((SqlDataReader)SqlDataSource2.Select(DataSourceSelectArguments.Empty), "SessionNo", "FluencyNo", "FluencyScore");