【发布时间】:2012-09-01 12:31:37
【问题描述】:
我有一个GridView,它是数据绑定的,在 button_click 上我想逐行读取GridView 每列并读取一行中每个单元格的值并更新数据库中的表?我也知道如何检查该单元格是否包含 null。
我正在尝试这样的事情并卡住了:
protected void SAVE_GRID_Click(object sender, EventArgs e)
{
int rowscount = GridView2.Rows.Count;
int columnscount = GridView2.Columns.Count;
for (int i = 0; i < rowscount; i++)
{
for (int j = 1; j < columnscount; j++)
{
// I want to get data of each cell in a row
// I want to read the corresponding header and store
}
}
}
【问题讨论】: