Put a SqlDatsource in the page . Configure it to connct to your DataBase and specify a SelectCommand. Set this DataSourse as the DataSource of your ListView. When page is run the ListView will display your data.
Kindly mark this post as "Answer", if it helped you.
Web Develope...
Member
10 Points
37 Posts
listview
May 01, 2012 01:31 AM|LINK
Hi
i have unordered list and i want to get data from database using listview where i can put the tages in listview templates
<ul>
<li></li>
<li></li>
</ul>
<ul>
<li></li>
<li></li>
</ul>
ans so on ......
webguy07
Participant
952 Points
234 Posts
Re: listview
May 01, 2012 02:08 AM|LINK
Your better off using a repeater like so. Just put what you want to repeat inside the ItemTemplate.
<ul> <asp:Repeater ID="rpt1" runat="server"> <ItemTemplate> <li><% #Eval("MyData")%></li> </ItemTemplate> </asp:Repeater> </ul>basheerkal
Star
10672 Points
2426 Posts
Re: listview
May 01, 2012 05:05 AM|LINK
Put a SqlDatsource in the page . Configure it to connct to your DataBase and specify a SelectCommand. Set this DataSourse as the DataSource of your ListView. When page is run the ListView will display your data.
(Talk less..Work more)
nijhawan.sau...
All-Star
16460 Points
3178 Posts
Re: listview
May 01, 2012 05:18 AM|LINK
Here's an example of using Listview with Databases.
You can then alter the itemtemplate of ListView.
http://www.codeproject.com/Articles/24570/Complete-ListView-in-ASP-NET-3-5