Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-12 Thread Rick McMullen
Scott, If your ArrayList (userList) only contains that values you need to add and they're in the order in which you want to add them (ie. firstname, lastname) to the table row it's pretty easy. You'll have to modify your approach a little. Try... for(int i=0; i wrote: >I did try a loop similar

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-08 Thread Scott A. Lawrence
I did try a loop similar to what you described (at the suggestion of another poster). Everything took longer yesterday since I was running it over a DSL connection (VPN into work), but things took longer with just the property references than they did with property references and row operations.

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Scott A. Lawrence
Chad suggested the same thing you did about profiling it without the row additions. I tried it with the built-in tracing stuff, and it looks like the retrieval of the properties is what is taking up all the time, not the actual row additions. It appears that the properties are pre-populated thoug

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Scott A. Lawrence
Good call on the AD reads. The timings are much longer by my running this over a VPN connection, but taking out the row operations has no effect on the total runtime (99 seconds with the row operations, 102 seconds without the row operations). On Wed, 7 Jan 2004 10:11:58 -0500, Chad M. Gross <[EM

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Joseph E Shook
To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable As I stated in my previous post, it is most likely due to your AD reads for the first and last name causing the performance problem not adding the rows to the datatable. For grins, if you run

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread J. Merrill
As someone else pointed out, and I don't remember seeing you acknowledge the point, you haven't AFAICT determined whether the code you've got is slow because it's creating and adding many DataRow objects to your ArrayList, or if it's slow because of the loop through the userList objects and refe

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Scott A. Lawrence
Interesting idea on returning an array of UserDirectoryObject. I know you can bind an array to a DataGrid. I know what classes need to be implemented in order to enable sorting on an array of UserDirectoryObject. What I'm not sure of is how I would replicate the row filtering functionality you g

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Michael J. Carter
On Wed, 7 Jan, 2004 09:21 -0500, Scott A. Lawrence <[EMAIL PROTECTED]> wrote: > I used the tracing functionality built into ASP.NET. The process of > populating the DataTable with the contents of the ArrayList is what is > taking up the majority of the time. But are you sure that the UserDirecto

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Fields, Jay
You could create a class such as UserDirectoryView and take your array as a parameter to the constructor. Additionally, have a UserDirectoryObject[] field that you update whenever the Filter property is set. If you are really concerned with performance, you could decompile the DataView and determ

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Chad M. Gross
As I stated in my previous post, it is most likely due to your AD reads for the first and last name causing the performance problem not adding the rows to the datatable. For grins, if you run this code excluding the row operations, how long does it take? ArrayList userList = theDirectory.getUsers

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Scott A. Lawrence
Very interesting idea, Mark. One thing I'm not sure of is how I would replicate the row filtering functionality you get automatically with DataView. On Tue, 6 Jan 2004 16:19:28 -0600, Marc Brooks <[EMAIL PROTECTED]> wrote: >You could just make your list actually expose the needed interfaces for

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-07 Thread Scott A. Lawrence
I used the tracing functionality built into ASP.NET. The process of populating the DataTable with the contents of the ArrayList is what is taking up the majority of the time. On Wed, 7 Jan 2004 01:18:06 GMT, Erick Sgarbi <[EMAIL PROTECTED]> wrote: >Have you tried to use CLRProfiler to find out w

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Erick Sgarbi
Have you tried to use CLRProfiler to find out where your 15 secs is going to? Regards, Erick Sgarbi > I'm writing a user profile tool that manipulates information in an LDAP > server. I'm using an abstraction layer that talks directly to the server > (written by another developer). The function

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Scott A. Lawrence
In order for ArrayList sort to work properly, I think I would need to implement IComparable and a specialized IComparer class. I would also have to come up with a way to implement row filtering for the array list. Since this functionality is easy to access via the DataView, once the initial penal

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Chad M. Gross
Scott, Im not certain how your DirectoryEntry wrapper class UserDirectoryObject is implemented but I would expect that it reads one property at a time from the DirectoryEntry object or loads them all or each one on demand from the UserDirectoryObject object. I would expect that your performance i

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Marc Brooks
You could just make your list actually expose the needed interfaces for a DataTable (derive from IBindingList on the list, IEditableObject on the items), then you don't need to create a DataTable at all! Marc Sample class below (Outlook syntax checker in scope): public class ListOfLines :

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Fields, Jay
I generally add my rows like so: for (int i=0;imailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 2:08 PM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable I'm writing a user profile tool that manipulates information in an LDAP server.

Re: [ADVANCED-DOTNET] Fastest way to add contents of ArrayList to a DataTable

2004-01-06 Thread Frans Bouma
Why aren't you binding the ArrayList directly? You can sort it as well, using the Sort() method. FB > I'm writing a user profile tool that manipulates information > in an LDAP server. I'm using an abstraction layer that talks > directly to the server (written by another developer). Th