You should change your code something like this
int count=0;int pagesize=20;
<pre lang="cs">foreach (GridViewRow g1 in GVSalDet.Rows)
{
if(count <= pagesize){
string insertsql = string.Format("insert into RepTab ( EmpID, EmpName GName,DName,CName,Sal,Ptax) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}' )", g1.Cells[1].Text.ToString(), g1.Cells[2].Text.ToString(), g1.Cells[3].Text.ToString(), g1.Cells[4].Text.ToString(),
g1.Cells[5].Text.ToString(),float.Parse(g1.Cells[6].Text.ToString()),float.Parse(g1.Cells[7].Text.ToString()));
module.ReportNonQuery(insertsql);
count +=1;
} }