Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. From datatable binding the mail body in runtime

From datatable binding the mail body in runtime

Scheduled Pinned Locked Moved ASP.NET
wpfwcf
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi runtime i am telling whats my mail body have to contain..., But its not at all considering that for loop of j and inside if condition: This is my code: foreach (FileInfo f in fInfos) { attach = new MailAttachment(f.FullName); for (int j = DS.Tables.Count - 1; j < DS.Tables.Count; j++) { if(Path.GetFileNameWithoutExtension(d.Name)==DS.Tables[j].Rows[0][1].ToString()) { mbody = "" + "" + "" + "" + "" + "" + "

    Time Sheet For Last Week Employee Details :

    Employee Name:

    Working Dates :

    Worked Dates :

    " + DS.Tables[j].Rows[0][2].ToString() + "

    " + DS.Tables[j].Rows[0][3].ToString() + "

    " + DS.Tables[j].Rows[0][4].ToString() + "

    "; } mailMessage.Body = mbody; }

    S 1 Reply Last reply
    0
    • M Member 3879881

      Hi runtime i am telling whats my mail body have to contain..., But its not at all considering that for loop of j and inside if condition: This is my code: foreach (FileInfo f in fInfos) { attach = new MailAttachment(f.FullName); for (int j = DS.Tables.Count - 1; j < DS.Tables.Count; j++) { if(Path.GetFileNameWithoutExtension(d.Name)==DS.Tables[j].Rows[0][1].ToString()) { mbody = "" + "" + "" + "" + "" + "" + "

      Time Sheet For Last Week Employee Details :

      Employee Name:

      Working Dates :

      Worked Dates :

      " + DS.Tables[j].Rows[0][2].ToString() + "

      " + DS.Tables[j].Rows[0][3].ToString() + "

      " + DS.Tables[j].Rows[0][4].ToString() + "

      "; } mailMessage.Body = mbody; }

      S Offline
      S Offline
      Sherin Iranimose
      wrote on last edited by
      #2

      New one wrote:

      for (int j = DS.Tables.Count - 1; j < DS.Tables.Count; j++)

      what you are trying to do with the loop? That loop always iterates one time.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups