Solved

Send email to every email registered in Database

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
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!
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

16 Experts available now in Live!

Get 1:1 Help Now