I have a GridView
in which i have placed textbox in item template of each column. I want to store the values which I will be entering in the textboxes to the database on button click.
protected void Button1_Click(object sender, EventArgs e)
{
GridView1.Visible = true;
DataTable dt = new DataTable();
DataRow row = dt.NewRow();
for (int i = 0; i < GridView1.Rows.Count; i++)
{
string UserID = GridView1.Rows[i].Cells[1].Text;
string q="insert into details (name) values('"+UserID+"')";
SqlCommand cmd = new SqlCommand(q, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
}
}
the problem is that the textboxes are not even visible when i run the page.