check the below article.
Display Columns as Rows in GridView in ASP.NET
in the article, author used, sample data for datatable, but you can modify as the result from your stored procedure or database query. Author also used "
" function, there you have to modify according to the your display structure.
hope it helps.