Solved

Send email to every email registered in Database

Posted on 2004-10-08
1
143 Views
Last Modified: 2010-04-15
Hi,

onpageload I want to fetch all email addresses in my employee database into a textbox separated with ",". This textfield will be used on a page for sending a newsletter to my employees.

anyone?
0
Comment
Question by:ginola14
1 Comment
 
LVL 18

Accepted Solution

by:
tusharashah earned 250 total points
ID: 12258378
To fetch emails from Database you can create a DataReader and Add it to TextBox One by one like following:


----------------------------------------------------------------------------------------------------------------------------------

string strConn = "Your ConnectionString";
OleDbConnection myConnection = new OleDbConnection(strConn);
myConnection.Open();
       
OleDbCommand cmd2 = new OleDbCommand("Select Emails from EmployeeTable;", myConnection)

OleDbDataReader objDR;
objDR = cmd2.ExecuteReader();
string strEmails = "";
while( objDR.Read() )
{
   strEmails += objDR["EmailColumn"].ToString() + ";" ;
}
objDR.Close();
 
 ----------------------------------------------------------------------------------------------------------------------------------

-tushar
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question