Net. I want something like a recyclerview where you have 1 card in the aspx file which keeps recurring according to the number of entries in the database. So if my database table has supposed 3 entries of a particular name then there should be 3 cards in the page.
Here's what I did till now: In my .aspx file:
<div class="item-card9">
<a href="info_page.aspx" class="text-dark">
<h4 class="font-weight-semibold mt-1">
<asp:Label ID="Label1" runat="server" >
<%# uni_name %>
</asp:Label>
</h4>
</a>
</div>
and for my aspx.cs:-
public string uni_name;
SqlCommand cmd = new SqlCommand();
//SQL connection here
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
cmd.CommandText = //select statement here
cmd.Connection = con;
SqlDataReader rd = cmd.ExecuteReader();
while (rd.Read())
{
uni_name = rd["name"].ToString();
}
this.DataBind();
con.Close();
}
With this as of now I'm only able to get 1 entry from my database, but I want it to keep recurring until the end of the database.