Hi qasimshahzaduae1
Please refer below sample code.
Here in this example I use Group By clause to get the Count of similar Countries.
Database
For this example I have used of Northwind database that you can download using the link given below.
Download Northwind Database
HTML
<div class="col-2">
<asp:Repeater ID="Internationaljobsrepeater" runat="server">
<ItemTemplate>
<a style="text-decoration: none;" href="jobdetail.aspx">
<div id="wb_Card2" style="display: inline-block; width: 288px; height: 244px; z-index: 6;" class="card">
<div id="Card2-card-body">
<div style="overflow: hidden">
<img class="Card2-card-item0" id="imageshowID" src='https://www.aspsnippets.com/assets/img/logo_ns.png'
width="292" height="70" style="background-color:black;" />
</div>
<div id="Card2-card-item1"><%#Eval("Country")%></div>
<div id="Card2-card-item2">ASPSnippets PVT. LTD.<i class="fa fa-check-circle"></i></div>
<div id="Card2-card-item3">Total Jobs: <%#Eval("Total")%></div>
</div>
</div>
</a>
</ItemTemplate>
</asp:Repeater>
</div>
Namespace
C#
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
VB.Net
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string qry = "SELECT Country,COUNT(EmployeeID) Total FROM Employees Group BY Country";
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlDataAdapter sda = new SqlDataAdapter(qry,con))
{
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
Internationaljobsrepeater.DataSource = dt;
Internationaljobsrepeater.DataBind();
}
}
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Dim qry As String = "SELECT Country,COUNT(EmployeeID) Total FROM Employees Group BY Country"
Using con As SqlConnection = New SqlConnection(constr)
Using sda As SqlDataAdapter = New SqlDataAdapter(qry, con)
Using dt As DataTable = New DataTable()
sda.Fill(dt)
Internationaljobsrepeater.DataSource = dt
Internationaljobsrepeater.DataBind()
End Using
End Using
End Using
End Sub
Screenshot