Solved

Send email to every email registered in Database

Posted on 2004-10-08
1
147 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 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