Re: DataTable Processing

From: Fred Nelson (fred_at_smartybird.com)
Date: 07/30/04


Date: Fri, 30 Jul 2004 14:09:25 -0400

Lucas:

Thanks VERY much for your help with this - I now have the info I need to
move forward.

>> Are you sure you looked all over MSDN? ; )

It must be there somewhere - I spent two hours last night looking at
examples and writing code that didn't work. After another two hours
this morning I made the post. I know that I'm a "newby" so that's
part/most of it - also the examples I found sooner or later ended up
talking about binding, XML, or other things above and beyond what I
needed.

I've noticed that very often there aren't good examples of simple
things. I have a bunch of books that seem to skip over the elementary
steps and immediately teach "binding to XML remote procedure calls that
access stored procedures after generating the meta data to implement a
concurrent backup"!

Sorry for that - I'm tired!!!

Anyhow: Thanks very much for your help!

Fred

Lucas Tam wrote:

> Fred Nelson <fred@smartybird.com> wrote in
> news:OPghfoldEHA.724@TK2MSFTNGP10.phx.gbl:
>
>
>>1) Go to the top and process sequentially in the order of the primary
>>key: (logically)
>>
>> datatable.gototop
>> while datatable.read
>> // actions
>> end while
>
>
> Use the DataTable.Select method to return an array of DataRows. Then you
> can loop through the array.
>
> OR
>
> Apply a DataView to the Datatable, ordering by the PK. Loop through the
> PK.
>
>
>
>
>>2) perfrom a direct lookup:
>>
>> dim soughtkey as string = "ABC"
>>
>> datable.read.keyvalue = soughtkey
>> if found
>> // process found
>> else
>> // process not found
>> endif
>>
>>I've looked all over MSDN and the web and can't find any examples of
>>how
>> to do this so any and all help would be GREATLY appreciated!
>
>
> Use the .Find method, or .Select or a Dataview.
>
> Are you sure you looked all over MSDN? ; )
>



Relevant Pages

  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying a large amount of data quickly (VB6)
    ... >>> involving a loop of VB code would be too slow. ... but I'd sure be interested to know if that StringBuilder ... Array elements: 25000 ... Array construction: 17 ...
    (microsoft.public.vb.controls)
  • Re: Problem with a script
    ... a loop there becomes impractical. ... You still have them as uniquely named array indexes... ... writing the code twice will only ... reading your entire code and parsing it in their head, ...
    (comp.lang.php)