Counter

  • Thread starter Thread starter Toodles
  • Start date Start date
T

Toodles

I have a dataset coming back in my .net app, and I need
to look at a particular field in that dataset, and if
there are multiple instances of that field (>1) then I
don't want it to send a particular email (that I have
coded in). If there is not an instance, then I want the
email to be sent. Basically I only want an email sent on
the first instance, and not thereafter. I think I need
to do this within a counter, but don't know how. Can
someone help? Thanks so much!

Toodles
 
Hi Toodles,

I type it in here and never did this so dont look for typos or small errors
it is just a try.

\\\
dim i as integer
dim y as new arraylist
for i = 0 to ds.tables(0).rowscount - 1
if y.indexof(ds.tables(0).rows(i)("fieldtotest") > -1 then
exit for
y.add(ds.tables(0).rows(i)("fieldtotest")
end if
next
if ds.tables(0).rowscount = arraylist.count then sendmail
///

Cor
 
Can you do a select distinct on that field in your original query? Then
you'll only get one of each value...
 
Back
Top