vb.net - Pivot a datatable in .NET Code -
i have stored procedure in sql returns following schema:
id category agebucket cnt amount 28 mack - class 8 1to60 1 88000 28 mack - class 8 1to89 1 88000 28 mack - class 8 over180 24 1067260.01 28 mack - class 8 over359 24 1067260.01 28 mack - class 8 over360 24 1067260.01 29 volvo - class 8 over180 19 869100 29 volvo - class 8 over359 19 869100 29 volvo - class 8 over360 19 869100 30 other - class 8 over180 13 232500.01 30 other - class 8 over359 13 232500.01 30 other - class 8 over360 13 232500.01
i want pivot in vb.net (for reasons) , output datatable should this:
id category salecategory [1to60] [1to89] [61to120] [90to179] [121to180] 28 mackclass8 n 88000 88000 0 0 0 29 volvoclass8 n 0 0 0 0 869100 30 otherclass8 n 0 0 0 0 232500.01
etc... so, have pivot agebucket
rows different columns. suggestions?
Comments
Post a Comment