string imgg=1,3,4,9,18 ,
imgg=imgg.TrimE nd(',');
string[] words = imgg.Split(',') ;
foreach (string word in words)
{
strrr = "select * from profiles where proid=" + int.Parse(word) ;
SqlDataSource2. SelectCommand = strrr;
GridView2.DataS ourceID = "sqldatasource2 ";
GridView2.DataB ind();
}
I am trying to add data to gridview in a loop with comma separated string. But everytime gridview remove previous data and bind only with last id. Please help i want to plus record in gridview with every loop.
imgg=imgg.TrimE nd(',');
string[] words = imgg.Split(',') ;
foreach (string word in words)
{
strrr = "select * from profiles where proid=" + int.Parse(word) ;
SqlDataSource2. SelectCommand = strrr;
GridView2.DataS ourceID = "sqldatasource2 ";
GridView2.DataB ind();
}
I am trying to add data to gridview in a loop with comma separated string. But everytime gridview remove previous data and bind only with last id. Please help i want to plus record in gridview with every loop.
Comment