Click here to Skip to main content
15,901,368 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi friends,

I want to list the computers along with the icons and links in ASP.NET...
I have the computers information in SQL,,, I wanna just populate the list...
what is the best way to do so,,, can anybody please guide me,,,
Something like this....

http://www.mediasmartserver.net/blog/wp-content/uploads/2009/08/LogMeIn-Beta-MY-COMPUTERS.JPG[^]
Posted
Updated 28-Aug-13 2:37am
v2
Comments
Jignesh Khant 28-Aug-13 8:41am    
You can use Data List control for this.
Yesudasan Moses 28-Aug-13 8:42am    
Is there a Listview Web controller for ASP.NET ?
Jignesh Khant 28-Aug-13 8:44am    
Yes.

 
Share this answer
 
Comments
Yesudasan Moses 29-Aug-13 7:25am    
Thanks,,, this solved my issue,,,
In Source:
XML
<asp:DataList ID="DataList1" runat="server"RepeatDirection="Vertical">
                        <ItemTemplate>
                             <asp:ImageButton ID="Image1" runat="server"   Height="200px"
                    ImageUrl='<%# Eval("url")%>' Width="200px" /><br />
                             <asp:Label ID="lblname" runat="server"
                                Text='<%# Eval("product_name") %>' />
                            <br />
                            Price:
                            <asp:Label ID="earing_priceLabel" runat="server"
                                Text='<%# Eval("earing_price") %>' />
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:DataList>


Then In code behind:

string constr = ConfigurationManager.ConnectionStrings["connstr"].ToString();
            SqlConnection con = new SqlConnection(constr);
            string sql = "SELECT * FROM product_table";
            SqlCommand cmd = new SqlCommand(sql, con);
            con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();
            DataList1.DataSource = rdr;
            DataList1.DataBind();
 
Share this answer
 
v2

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