Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a grideview with column of type datagridviewtextbox , how can i insert data to database from this column, text may exist or may not exist , in that cell
Posted
Comments
KaushalJB 28-May-14 6:33am    
Have you tried anything ?

Move the value for cell to variable

C#
  for(int i = 0 ;i<datagrid.rows.count ; i++) 
{
    string a1 = datagrid.rows[i][0].value;
    string a2 = datagrid.rows[i][1].value;

     Save Query;

}
 
Share this answer
 
v2
try this.. :)

C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            TextBox myTextBox = (TextBox)(e.Row.Cells[1].FindControl("TextBox1"));


       // ..insert code


        }
    }
 
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