Solved

Send email to every email registered in Database

Posted on 2004-10-08
1
142 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now