murali athmuri

murali athmuri

  • NA
  • 36
  • 59.4k

How to retrive dynamic gridview data and store into db.

Jan 8 2013 4:48 PM
Dear sir,



I have created dynamic columns for gridview. In that gridview every cell containing two dropdown list.


one is for lecturer name with id. and another one is subject name.



My problem is how to retrive data from dynamic gridview and store into database.


I am using

  foreach (GridViewRow r in GridView2.Rows)
        {


for (int i = 1; i < GridView2.Rows.Count; i++)
                {
                    if (r.RowType == DataControlRowType.DataRow)
                    {

string box = r.Cells[1].Text;
            
  DropDownList box1 = (DropDownList)GridView2.Rows[i].Cells[0].FindControl("ddlnewList");



}
}


}


I am getting null value .Please solve my problem.

Answers (3)