I have some list of data in datagridview. More than 500 records in datagridview. i want to insert into database like this

for i =1 to 40

insert query 1.....

next

for i = 41 to 80

insert query 2.....

next

for i = 81 to 120
insert query 1.....

next

for i = 121 to 160
insert query 2.....

next

how to write a code in vb.net?