Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to insert multiple rows of data from a gridview to database Of atleast 4 columns. The gridview is without textboxes...

Regards
Sabir Jani.
Posted

1 solution

C#
bool firstTime = true;

   System.Data.DataTable dt;
   protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)
           if (this.firstTime)
           {
               System.Data.DataView dv =
                    (e.Row.DataItem as System.Data.DataRowView).DataView;
               this.dt = dv.ToTable();
               this.Label1.Text = dt.Rows.Count.ToString();
               this.firstTime = false;
           }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900