Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all,
I am having one table in sql server database named as emp shown below,

Empid Empname salary
101 ddd 1212
102 lll 4545

What i am expecting is, I want same data in datalist or gridview control like below format

Empid 101 102
Empname ddd lll
Salary 1212 4545

Please send how to do...

Thank you
Posted
Updated 21-Jan-11 22:09pm
v2

in datalist it is quite easy just do like it


XML
<asp:DataList ID="DataList1" runat="server">
        <ItemTemplate>
        <table width="100%">
        <tr>
        <td >Employee Id:</td><td><%# DataBinder.Eval(Container.DataItem, "Empid")%></td>
        </tr>
         <tr>
        <td >Employee Name  :</td><td><%# DataBinder.Eval(Container.DataItem, "Empname ")%></td>
        </tr>
          <tr>
        <td >Salary    :</td><td><%# DataBinder.Eval(Container.DataItem, "Salary  ")%></td>
        </tr>
        </table>
        </ItemTemplate>
        </asp:DataList>
 
Share this answer
 
I already answered it here: Interchange repeater control rows and columns[^]

Have you checked the given links in the answer? Give it a try. No one here will give you the full code.

And please do not create multiple posts for the same question.
 
Share this answer
 
Hi
Googled on "Transpose Query" or Cross-Tab Reports.

See These Q & A's (already got answers)
Cross-Tab Query's[^]

search data in crystal report[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900