Click here to Skip to main content
15,913,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 5000 records in list so i have to send first 1000 record then in next iteration next 1000 record ie 1001 to 2000 in this way i have to send all the record step by step

What I have tried:

i have treid for loop but its not working for me
Posted
Updated 15-Jun-16 21:11pm
Comments
BillWoodruff 16-Jun-16 2:56am    
"i have treid for loop but its not working for me"

So, single step through the code and describe the errors or what happened that you did not expect to happen, or, what did not happen that you expected to happen.

1 solution

Assuming this is to a database...
There are a load of ways to do this, but the simplest is probably to create a DataTable, load it with 1000 rows, and use the SqlBulkCopy Class (System.Data.SqlClient)[^] to load it to the DB.
There is an example of using SqlBulkCopy here: Multiple SQL INSERT Operations with a Single Command[^] which may be of help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900