I tried to keep all the data in the gridview when paging, but when I try to save it, which appears in my database only when it is active pages .. ex: in the first and second page I have data in gridview .. when I save, the stored in the database only the first or second page of course .. so I like to keep all my data in gridview when paging..
i have tried using : foreach (GridViewRow row in GridCustomColumn.Rows) but it's not working..
your answer will be very helpful , thanks
string sql1;
foreach (GridViewRow row in GridCustomColumn.Rows)
{
string report_id = lblreportid.Text;
string columnname = (row.FindControl("lblcolumn") as Label).Text;
string columntext = (row.FindControl("txttextcol") as TextBox).Text;
string columnsize = (row.FindControl("txtsize") as TextBox).Text;
string sql = "delete " +
" from report_column where report_id='" + report_id + "' and column_name='" + columnname + "'";
sql1 = "insert into report_column " +
"values('" + report_id + "', '" + columnname + "', '" + columntext + "','" + columnsize + "');"+
"select * from report_column";
lblmsg.Text += "berhasil untuk tambah report column !!";
mda.execSQL(sql + sql1, connStr);
}
}