hi, im still having problems in how to pass the results of the sql command to the email body, heres what i have so far
SqlCommand emailCommand = new SqlCommand("SELECT fileName, fileType, fileSize, fileLocation, fileDescription, Compressed, compressedSize FROM aspnet_Files WHERE fileOwner = '" + User.Identity.Name + "'", myConnection);
string userEmail = userEmailAddress.ExecuteScalar().ToString();
string backupReport = emailCommand.ExecuteNonQuery().ToString();
MailMessage m = new MailMessage();
m.To.Add(userEmail);
m.From = new MailAddress("postmaster@domain.net");
m.Subject = "Your Personal Backup Report";
m.Body = backupReport;
m.Priority = MailPriority.High;
SmtpClient client = new SmtpClient();
// try{
client.Send(m);
btnEmailReport.Text = "Report Sent Successfully!";
btnEmailReport.Font.Bold = true;
btnEmailReport.ForeColor = System.Drawing.Color.Green;
string backupReport = emailCommand.ExecuteNonQuery().ToString();
- this line is where the problem lies (only returns one column of one row), how do i return the full results as a string to put in the mail body?
Thanks