| Author: manoj 02 Sep 2008 | Member Level: Silver | Rating:  Points: 2 |
hai
if u are fetching a date from database means just u fetch a date in this format convert(varchar(12),Date(databsefieldname),103) as Date
|
| Author: Karthikeyan S 02 Sep 2008 | Member Level: Gold | Rating:   Points: 3 |
Hi,
1. Whether you used the .ToString() function to format the datetime variable. If so it should work compulsarly else you have did some other mistake.
Syntax for this is: String lstrDate = ldateLoggedInDate.ToString("dd-MMM-yyyy");
2. Get data from database to a datatable.
a. Get data from database to a datatable: query for this 'SELECT Email_ID FROM EMAIL_TABLE' and use the dataadapter and fill the datatable "ldtEmailIDs".
b. use foreach loop and concatenate each email ids.
System.Net.Mail.MailMessage newEmail = new System.Net.Mail.MailMessage(); // or you can use smtp email also ur choice.
foreach(DataRow ldr in ldtEmailIDs.Rows) { //newEmail.To.Add("abcd@abcd.com"); newEmail.To.Add(ldr[0].ToString()); // in this way get emailids from //db and add it to "To" object of email object. }
... your code follows.
|
| Author: sweety 02 Sep 2008 | Member Level: Silver | Rating:   Points: 3 |
protected void ButtonSubmit_Click(object sender, System.EventArgs e) { Server.ScriptTimeout = 1000; Response.Flush();
SmtpMail.SmtpServer = "localhost"; MailMessage mail = new MailMessage(); mail.To = this.TextBoxTo.Text; mail.Cc = this.TextBoxCc.Text; mail.Bcc = this.TextBoxBcc.Text; mail.From = this.TextBoxFrom.Text; mail.Subject = this.TextBoxSubject.Text; mail.Body = this.TextBoxBody.Text;
try { SmtpMail.Send(mail); Response.Write("The Mail has been sent to: "); Response.Write(mail.To); Response.Write(mail.Cc); Response.Write(mail.Bcc); } catch(System.Exception ex) { Response.Write(ex.Message); }
Response.Flush(); }
Points of Interest
|
| Author: Sabu C Alex 03 Sep 2008 | Member Level: Gold | Rating:  Points: 2 |
hai
DateTime dt = DateTime.Now; String dte = dt.ToString("dd-MMM-yyyy");
Hope this will help you Sabu
|