1
Answer

how to use WCF to retrieve data from sQl server2005.

how to use WCF to retrieve data from sQl server2005. using asp.net c# language and show it in crystal report.
if i pick the date i have to select the data from the table where date='"+date.+"'  after click the button and show it in crystal report
Answers (1)
0
Kirtan Patel

Kirtan Patel

NA 35k 2.8m 15y
Why don't you use Gmail Server . its working well ..

Yahoo Server Does not Provide..SMTP Service for Free

follow this great article ..you will have idea about sending mail with attachment .

http://www.c-sharpcorner.com/UploadFile/meetuchoudhary/sendmail08142009123125PM/sendmail.aspx

code is for asp.net but its working under Windows Form application too...

if my answer helped you then check "Do you like this answer" check box


Accepted
0
hanafi tanudjaja

hanafi tanudjaja

NA 41 0 15y
hello home base


thank you

it work

regard
han
0
Lalit M

Lalit M

NA 6.7k 48k 15y
You can also try this code sample


MailMessage Mail = new MailMessage();

MailAddress ma = new MailAddress(txtFrom.Text,txtName.Text);
Mail.From = ma;
Mail.To.Add(txtTo.Text);

if(txtCC.Text.Trim().Length != 0)
Mail.CC.Add(txtCC.Text);

if(txtBCC.Text.Trim().Length != 0)
Mail.Bcc.Add(txtBCC.Text);

Mail.Subject = txtSubject.Text;


if (txtAttachment.Text.Trim().Length != 0)
{
string sAttach = txtAttachment.Text.Replace("\\","\\\\");
Mail.Attachments.Add(new Attachment(sAttach));
}


//Note: When you make "
IsBodyHtml" to true make
//ValidateRequest="
false" in page derective
//As to make HTML content passed.
Mail.IsBodyHtml = true;
Mail.Body = txtComment.Text;


//Setting Reply address.
if (txtReplyTo.Text.Trim().Length != 0)
{
Mail.Headers.Add("
Reply-To", txtReplyTo.Text);
}
else
{
Mail.Headers.Add("
Reply-To", txtFrom.Text);
}


try
{
SmtpClient smtpMailObj = new SmtpClient();
//eg:localhost, 192.168.0.x, replace with your server name
smtpMailObj.Host = "
myMailServer";
smtpMailObj.Send(Mail);
Response.Write("
Your Message has been sent successfully");
}
catch (Exception ex)
{
Response.Write("
Message Delivery Fails");
}

reference link

more info

hope you will get your answer,Thanks ....