From datatable binding the mail body in runtime
-
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; }
-
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; }
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.