
You should write a recursive method...
Beow is a sample code , which gives a baisc idea.
Void ReloadDataFromDataBase(int num)
{
DataSet ds=null;
if(num==0)
ds= FetchDataFromThisRecord(num)
Else
ds= FetchDataFromThisRecord(num)
using (var writer = new StreamWriter("foo.txt"))
{
private int counter=0; // set the 1000 counter value
if(ds !=null )
{
foreach(var data in ds.tabels[0].rows)
{
// loop through your dataset ...depending on your requirement
//before writing data to file check
if(counter > 1000)
ReloadDataFromDataBase(counter); // pass the counter counter value when it reaches 1001...
// Write your data here
writer.Write("{0:0.0} ", i);
}
}
}
}
Hemali, if this helps please login to Mark As Answer. | Alert Moderator