Hello:
I am trying to change a a value in my datarow column
["EmailSent"] from "no" to "yes"... I would like to do
it inside my loop... Does anyone have any suggestions on
how to do it. Thank you very much for your help... I
have placed the code here:
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
string path = Server.MapPath("requests.xml");
ds.ReadXml(path);
foreach (DataRow Ord in ds.Tables["request"].Rows)
{
string id = Ord["id"].ToString();
string name = Ord["Name"].ToString();
string email = Ord["Email"].ToString();
string emailSent = Ord["EmailSent"].ToString();
string apptSetDate = Ord["dateTime"].ToString();
string date1 = Ord["Date"].ToString();
string time = Ord["Time"].ToString();
string ampm = Ord["AmOrPm"].ToString();
string procedure = Ord["jobCode"].ToString();
string date2 = System.DateTime.Today.AddDays
(3).ToShortDateString();
int dog = compareDates(date1,date2);
if(dog == 0 && emailSent == "no")
{
try
{
MailMessage Mailer = new MailMessage();
Mailer.From = "johnpyke@avonlakedental.com";
Mailer.To = email;
Mailer.Bcc = "t_wasserman@lycos.com";
Mailer.Subject = "Avon Lake Dental Appointment
Reminder";
string picPath = Request.QueryString.ToString();
string strBody = "Hello " + name + ". This is
just a note to remind you of " +
"your appointment at " + time + ampm + " on " +
date1 + " for a " + procedure +
". This email reminder was set for you on " +
apptSetDate + ".";
Mailer.Body = strBody;
Mailer.BodyFormat =
System.Web.Mail.MailFormat.Text;
SmtpMail.SmtpServer = "smtp-
gh.AVONLAKEDENTAL.COM";
SmtpMail.Send(Mailer);
//Change Value of EmailSent = "yes"
}
catch
(Exception ex)
{
MailMessage Mailer = new MailMessage();
Mailer.From = "johnpyke@avonlakedental.com";
Mailer.To = "t_wasserman@lycos.com";
Mailer.Subject = "Avon Lake Dental Email Problem";
string strBody = "There was an error emailing out
the Appointments. " +
" Here is the message " + ex.Message;
Mailer.Body = strBody;
Mailer.BodyFormat =
System.Web.Mail.MailFormat.Text;
SmtpMail.SmtpServer = "smtp-
gh.AVONLAKEDENTAL.COM";
SmtpMail.Send(Mailer);
}
ds.AcceptChanges();
}
}
}
}