title: Session not working in Windows service application?
body: <p>i am trying to use <strong>Session["emailcc3"]</strong> in windows service application ..but it shows me an error session not available in this context....is there any alternative way to do that??</p>
  
  <p>THIS IS MY CODE:</p>
  
  <pre><code> foreach (DataRow newRow in employee.Rows)
                  {
                      num = num - 1;
  
  
  
                      if (num == 4)
                      {
                          Session["emailto"] = newRow["EMAILID"].ToString();
                      }
                      if (num == 3)
                      {
                          Session["emailcc1"] = newRow["EMAILID"].ToString();
                      }
                      if (num == 2)
                      {
                          Session["emailcc2"] = newRow["EMAILID"].ToString();
                      }
                      if (num == 1)
                      {
                          Session["emailcc3"] = newRow["EMAILID"].ToString();
                      }
  
                  }
  
                  string emailto = Session["emailto"].ToString();
  
                  string emailcc1 = Session["emailcc1"].ToString();
  
                  string emailcc2 = Session["emailcc2"].ToString();
  
                  string emailcc3 = Session["emailcc3"].ToString();
  </code></pre>