Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I am suffering from a strange problem. I made a functionality in which we can send mails to n number of users how far i just have 181 at the moment. I send them mails on daily basis and at the end of process the label appears with text "Success" and at the same time I make note of history which I show afterwards in grid view through a button that appears after sucesfull sending of emails. I have just launched my project and initially it was fine but today I saw that I have send emails and process was completed long ago still my progress image was there revolving and made me assume that process is still going on. Than when I clicked on the link somewhere on the page it logged me out. After logging in and I went to my history page and saw that history was succesfully recorded and mails were succesfuly sent but during the process the success message didn't came up and neither the progress image dissapeared as it was supposed to be. Why did that happen ? Is it due to some page rendering or post back issue from server. When i tested it on local it was working absolutely fine. I am scared that if this will continue to happen It will create issues for my project.
I didn't posted the code because process is working fine only the confirmation is an issue.

C#
for (int ict = 0; ict < dtRecords.Rows.Count; ict++)
{

    int iWorkOrderNumb = Convert.ToInt32(dtRecords.Rows[ict]["WorkOrderNumber"]);
    string strworkOrder = Convert.ToString(dtRecords.Rows[ict]["WorkOrderName"]);
    string strdata = Convert.ToString(dtRecords.Rows[ict]["DataType"]);
    string strHSCODE = Convert.ToString(dtRecords.Rows[ict]["HSCODE"]);
    string strCombination = Convert.ToString(dtRecords.Rows[ict]["Combination"]);
    string strProd = Convert.ToString(dtRecords.Rows[ict]["Product"]);
    string strProd_Not = Convert.ToString(dtRecords.Rows[ict]["Product_Not_Like"]);
    string strActive = Convert.ToString(dtRecords.Rows[ict]["IsActive"]);
    string strEmailId = Convert.ToString(dtRecords.Rows[ict]["EmailId"]);
    string strPortname = Convert.ToString(dtRecords.Rows[ict]["Ind_Port"]);

    DateTime date_from_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateFrom"]);
    DateTime date_to_subscp = Convert.ToDateTime(dtRecords.Rows[ict]["DateTo"]);

    if (strActive == "NO")
    {

        DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
        strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
    }


    else if (strActive == "YES")
    {

        //((date_from_for_daily_email < date_start) ||
        if (date_to_for_daily_email > date_end)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
            String strmsg = "You cannnot select a date less than last mailed date and greater than " + date_end.ToString("dd-MMM-yyyy") + ".";
            PopUp_Generation(strmsg);
        }
        else if (date_from_for_daily_email > date_to_for_daily_email)
        {
            //lblMsg.Visible = true;
            //lblMsg.Text = "Invalid date range. Please check the dates and than try again...";
            string strmsg = "Invalid date range. Please check the dates and than try again...";
            PopUp_Generation(strmsg);
        }

        else if (date_to_subscp < date_to_for_daily_email)
        {

            DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
            strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";

        }


        else
        {
            string[] strArr_email_list = null;
            strEmailId = strEmailId.TrimEnd(',');
            strArr_email_list = strEmailId.Split(',');
            for (int i_count_email = 0; i_count_email < strArr_email_list.Length; i_count_email++)
            {
                string strEmailID_of_User = Convert.ToString(strArr_email_list[i_count_email]);
                iResult = bl_Query_for_admin.Query_Data_Email_Attachment(iWorkOrderNumb,strworkOrder, strdata, date_from_for_daily_email, date_to_for_daily_email, strHSCODE, strCombination, strProd, strProd_Not,strPortname,strEmailID_of_User);
                if (iResult == 1)
                {
                    strSucessEmail += "" + strEmailID_of_User + ", ";
                }
                else
                {
                    DataTable dt_info = bl_daily_email.fetch_failed_credentials(iWorkOrderNumb);
                    strFailedEmail += Convert.ToString(dt_info.Rows[0]["EmailId"]) + " - " + Convert.ToString(dt_info.Rows[0]["DataType"]) + " - " + Convert.ToString(dt_info.Rows[0]["WorkOrdername"]) + ", ";
                }


                if (iResult == 1)
                {
                    if (flag == 0)
                    {
                        bl_myAccount.insert_last_daily_email_date(date_to_for_daily_email);

                        flag = 1;
                    }
                    lblMsg.Visible = true;

                    lblMsg.Text = "Email Sent Succesfully !!!";
                    continue;
                }




            }


        }

    }

}





btnLog.Visible = true;
gvAllClients.Visible = true;
Session.Remove("chk_state");
inserting_mail_history(ref strSucessEmail, ref strFailedEmail);

Please suggest me the reason and cure !
Posted
Updated 21-Sep-12 1:16am
v2
Comments
OriginalGriff 21-Sep-12 7:11am    
Without the relevant code to give us a clue, we can do nothing...
_Amy 21-Sep-12 7:11am    
Where is your dummy code? Which code you are using for it?
Taresh Uppal 21-Sep-12 7:16am    
here is my dummy code too...
Taresh Uppal 21-Sep-12 7:30am    
any help now ???
How are you working with Progress Bar ?
Can you show us the related code of progress Bar ?

1 solution

Which .net framework you are using...?
 
Share this answer
 
Comments
Taresh Uppal 28-Sep-12 3:15am    
3.5 and i guess that has nothing to do with it..its some server side breakdown occurence if m not wrong..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900