S
SetonSoftware
I'm pulling a series of DataTables to feed to a report. Each of the
stored procedures will require a few seconds to run so to speed up
response time I'm trying to use VS2010's parallel programming feature.
Here's the code I have so far:
List<DataTable> crDataList = new List<DataTable>();
Parallel.For(0, 2, i =>
{
GetData(crDataList, i);
});
private void GetData(List<DataTable> crDataList, int i)
{
crDataList.Add(GetDT(i));
}
GetDT() will execute a different stored proc depending on the value of
i passed. I want to fill the generic List crDataList with the
DataTables returned from the different stored rpocs. I'm only getting
the first one. What am I missing here?
Thanks
Carl
stored procedures will require a few seconds to run so to speed up
response time I'm trying to use VS2010's parallel programming feature.
Here's the code I have so far:
List<DataTable> crDataList = new List<DataTable>();
Parallel.For(0, 2, i =>
{
GetData(crDataList, i);
});
private void GetData(List<DataTable> crDataList, int i)
{
crDataList.Add(GetDT(i));
}
GetDT() will execute a different stored proc depending on the value of
i passed. I want to fill the generic List crDataList with the
DataTables returned from the different stored rpocs. I'm only getting
the first one. What am I missing here?
Thanks
Carl