Hello.
In runtime my app gets data from MSSQL server and there's an object that pulls the data into my custom dataset. Here's the code:
public static void FillRegionData(int country, RegionDataTable DestinationTable)
{
DestinationTable.Clear();
using (selectRegionsListTableAdapter _taSource = new selectRegionsListTableAdapter())
{
BusStationDataSet.selectRegionsListDataTable _tblSource = _taSource.GetData(country, Settings.Default.DataLanguage);
foreach (BusStationDataSet.selectRegionsListRow row in _tblSource.Rows)
{
DestinationTable.Rows.Add(new object[] {
row.region,
row.country,
row.title });
}
}
}
Everything goes fine until foreach starts working. A bit more than 100 rows causes the whole app to hang for several seconds.
Any ideas why this code is so slow?