i tried to do it dynamically iy wasnt showing anything
public void Getgallery(string username)
{
// int followerid;
// int followingid;
string str = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
string getADPOST = "GetNewrecord";
using (SqlConnection con = new SqlConnection(str))
{
con.Open();
using (SqlCommand cmd = new SqlCommand(getADPOST, con))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@UserName", Session["userName"]);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Id", typeof(int)),
new DataColumn("UserName", typeof(string)),
new DataColumn("ImageName",typeof(string)) });
var result = dt.AsEnumerable().Take(5);
DataTable ds = dt.Clone();
foreach (DataRow dr in result)
{
ds.Rows.Add(dr["Id"], dr["ImageName"]);
}
Repeater1.DataSource = ds;
Repeater1.DataBind();
}