Using foreach for insert gridview data into sql database

前端 未结 5 730
有刺的猬
有刺的猬 2021-01-24 03:34

I have a client side gridview data and I want to insert gridview data to sql database . at first I import data from excel to gridview and now I want to insert it into sql datab

5条回答
  •  天涯浪人
    2021-01-24 04:07

    Try like this ,

    If all the controls are label

    foreach (GridViewRow GVRow in GridView1.Rows)
        {
    
      Label lbl = (Label)GVRow.FindControl("labelID");
    
      string data=lbl.Text;
    
    }
    

提交回复
热议问题