title: how to append data into excel file
body: <pre><code>designation table:
  
  deg_no  deg_name
  1   XYZ
  2   ABC
  3   pqs 
  4   qwe
  5   tyu
  6   pqr
  7   lkj
  8   you
  9   zzz
  10  xxx
  
  
  ds = cls.ReturnDataSet("RetriveData_Alias1",
           new SqlParameter("@Field", "deg_no"),
          new SqlParameter("@TblNm", "designation"));
  
  
  for (int i = 0; i &lt; ds.Tables[0].Rows.Count; i++)
  {
      DataSet ds1 = new DataSet();
      ds1 = cls.ReturnDataSet("RetriveData_Alias1",
        new SqlParameter("@Field", "user_id,user_name"),
        new SqlParameter("@TblNm", "User_details"),
        new SqlParameter("@WhereClause", "where deg_no ='" + ds.Tables[0].Rows[i]["deg_no"].ToString() + "' "));
  }
  </code></pre>
  
  <p>this for loop will run until the deg_no=10 and gives the all the user details and it is gives the perfect output as i want
  the output.</p>
  
  <p>but i want to write these data into excel file : user_details.xls</p>
  
  <p>for suppose when i=1, then it will give you</p>
  
  <pre><code>user_id   user_name    deg_no
  1          xyz      1
  </code></pre>
  
  <p>and for i=2</p>
  
  <pre><code>user_id   user_name    deg_no
  2          pqr      3
  </code></pre>
  
  <p>and so on...</p>
  
  <p>but without create new file each time .</p>
  
  <p>suppose on first loop it will insert record of user_id =1
  then in second loop the details of user_id=2 is append in the same file without creating a new file.</p>
  
  <p>how can i do that?</p>