I have an array of about 1000 items that I want to display in a datagrid.
Currently, I created a array object for each item, copy the data to the data
row, then add the row to the datatable
foreach (items o in c)
{
object[] data = new object[]{c.Name,
pdp,
countryName,
c.PhoneNumber,
c.UserDefined,
Int32.Parse(c.ContactId),
imageList1.Images[1]};
this.contactDataSet.Tables["Contacts"].LoadDataRow(data,true);
}
This is taking about 15 seconds to complete 1000 rows. Can anyone suggest a
technique to make this process faster. Can all the rows be added in bulk,
instead of one at a time? Could there be some constraint checking that slows
down the above process?
Thanks
Mogli.
Currently, I created a array object for each item, copy the data to the data
row, then add the row to the datatable
foreach (items o in c)
{
object[] data = new object[]{c.Name,
pdp,
countryName,
c.PhoneNumber,
c.UserDefined,
Int32.Parse(c.ContactId),
imageList1.Images[1]};
this.contactDataSet.Tables["Contacts"].LoadDataRow(data,true);
}
This is taking about 15 seconds to complete 1000 rows. Can anyone suggest a
technique to make this process faster. Can all the rows be added in bulk,
instead of one at a time? Could there be some constraint checking that slows
down the above process?
Thanks
Mogli.