TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jeenath kumar
1.7k
64
3.7k
how to dynamically using repeater control
Aug 22 2019 2:56 AM
Hi...
i had a table
sno
title
query
1
Total Customer
select isnull(sum(cus_id),0) from customer
2
Total Products
select isnull(sum(prod_id),0) from product
what i tried
in .aspx
<asp:Repeater ID=
"rtrDashboard"
runat=
"server"
>
<ItemTemplate>
<div
class
=
"col-lg-3"
>
<div
class
=
"test"
>
<h4>
<%#Eval(
"title"
)%></h4>
<br />
<p>
<asp:Label ID=
"lblvalue"
runat=
"server"
Text=
'<%#Eval("query")%>'
></asp:Label>
</p>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
in aspx.cs
public
void
bindrepeater()
{
using
(SqlConnection con =
new
SqlConnection(constr))
{
DataTable dt =
new
DataTable();
try
{
con.Open();
SqlCommand cmd =
new
SqlCommand(
"select * from DashBoard order by dash_order"
, con);
DataSet ds =
new
DataSet();
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
da.Fill(ds);
dt = ds.Tables[0];
rtrDashboard.DataSource = dt;
rtrDashboard.DataBind();
}
catch
(Exception ex)
{
ex.Message.ToString();
}
finally
{
con.Close();
}
}
}
i don't know how to execute 3rd column query and set the value in label
Reply
Answers (
5
)
How to use Bootstrap data table in asp.net core mvc
insert limited data into ms-access database datewise in c#