I have a problem when when while loop repeats it iteration the already binded is replacing by new records but i want to bind all data by the iteration of while loop.
I am a new I have no idea how it can be.
while (i >= 0)
if (i != 0)
group_idd = group_ids[--i];
SqlConnection connection3 = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection_String"].ConnectionString);
using (SqlCommand cmdd = new SqlCommand())
cmdd.CommandText = "SELECT [news_category],[id] FROM [news_profile] WHERE [user_id]='" + user_id + "' AND [group_id]='" + group_idd + "' AND [profile_id] IS NOT NULL";
cmdd.Connection = connection3;
GridView1.DataSource = cmdd.ExecuteReader();
if (i == 0)