Mutli Email

G

Guest

I'm writting a page to send multi emails (just a few at a time, max 100) once
a day.
should this be done using just a reader, or is there a way to do this with a
dataset?
thanks
 
M

Mr Newbie

If all you are doing is reading from the database and not updting it then
the reader is the fastest (one way) and most simple data aquisistion.


HTH
 
S

S. Justin Gengo

Kes,

That depends. A reader will keep a connection to the database open while
you're looping through the records. If you have a delay built into the loop
that connection may be open a long time.

I would probably put the records directly into a datatable (you shouldn't
need the overhead of a dataset) then the connection will close right away
while your loop runs.

If this is being triggered from a website and is going to take a while to
run you will probably run into timeout issues. You may want to think about
starting up a new thread to run this send routine and then poll that thread
to see when it finishes.

Here's an article on multi-threading in web apps that I think will help you:
http://www.ftponline.com/vsm/2002_11/magazine/features/chester/

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
M

Mr Newbie

I see your logic regarding loop action extending the time the loop takes to
complete, but my understanding is that the DataReader is quicker natively at
getting the data in that using the full compliment of data objects. I cant
substantiate this with impirical data but I have read as much in several
articles over the last few years.

Am I wrong in this assertion ?, and if so, then why ?

Regards - Mr N


S. Justin Gengo said:
Kes,

That depends. A reader will keep a connection to the database open while
you're looping through the records. If you have a delay built into the
loop that connection may be open a long time.

I would probably put the records directly into a datatable (you shouldn't
need the overhead of a dataset) then the connection will close right away
while your loop runs.

If this is being triggered from a website and is going to take a while to
run you will probably run into timeout issues. You may want to think about
starting up a new thread to run this send routine and then poll that
thread to see when it finishes.

Here's an article on multi-threading in web apps that I think will help
you: http://www.ftponline.com/vsm/2002_11/magazine/features/chester/

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
K

Kevin Spencer

You are correct.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.

Mr Newbie said:
I see your logic regarding loop action extending the time the loop takes to
complete, but my understanding is that the DataReader is quicker natively
at getting the data in that using the full compliment of data objects. I
cant substantiate this with impirical data but I have read as much in
several articles over the last few years.

Am I wrong in this assertion ?, and if so, then why ?

Regards - Mr N
 
S

S. Justin Gengo

Yes,

It will really depend on how many emails are being sent. A connection
shouldn't be opened for a long time, and therefore it's possible that a
datatable may be the better vehicle in this case.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Mr Newbie said:
I see your logic regarding loop action extending the time the loop takes to
complete, but my understanding is that the DataReader is quicker natively
at getting the data in that using the full compliment of data objects. I
cant substantiate this with impirical data but I have read as much in
several articles over the last few years.

Am I wrong in this assertion ?, and if so, then why ?

Regards - Mr N
 
M

Mr Newbie

Thanks for the validation on that point.



Kevin Spencer said:
You are correct.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Big things are made up of
lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top