Hey there,
You need check if the
DataTable
exists in the
ViewState
, if yes then use that one instead of creating a new one every time. Use something like this after creating the
DataTable
object somewhere above
for
loop (You didn't post that part), that way will adding Rows to previously saved DataTable in the ViewState:
if(ViewState["BatchTable"] != null)
{
dt = (DataTable)ViewState["BatchTable"];
}
Hope it helps, do let me know if it isn't what you were looking for.
Azee...