开发者

how to ge the filled grid view data to database

I have a grid filled with data.so i need, that data to the another table in the database. i am usi开发者_如何学Pythonng a button by clilcking that button data in grid is to be stored in the database. i have tried but how to retrieve the grind indexes which are filled with data


You can access the data of gridview by using for loop, please see below code:
Suppose your Gridview is "gv"

for (int i = 0; i < gv.Rows.Count; i++)
{
TextBox txt = (TextBox)gv.Rows[i].FindControl("txtorder");
int id = Convert.ToInt32(gv.DataKeys[_count].Value);
// You can get gridview data and pass it into another table by firing insert query here.
}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜