Convert date formate in .xls file, while exporting the file using c#
<p>I am exporting data to .xls file(Excel doc) by using C#.net. 
here I have a one <strong>date</strong> field. Now i want to change the date format. Diff-Diff date formats in the Excel document.</p>

<pre><code>protected void ExportToExcel(DataSet ds, string FilePath)
        {
            StreamWriter sw;
            StringBuilder strFileContents = new StringBuilder();
            strFileContents.Append("ID" + "\t" + "ItemName" + "\t" + "Initiated By" + "\t" + "Date of Initiation" + "\t" + "Date of Expiry" + "\t" + "Item Price" + "\t" + "Name" + "\t" + "Phone" + "\t" + "Company" + "\t" + "Address");
            strFileContents.Append("\n");
            if (ds != null)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    strFileContents.Append(row["ID"] + "\t");
                    strFileContents.Append(row["ItemName"] + "\t");
                    strFileContents.Append(row["UserName"] + "\t");
                    strFileContents.Append(row["DealInitiatedOn"] + "\t");
                    strFileContents.Append(row["DealExpiryDate"] + "\t");
                    strFileContents.Append(row["ItemPrice"] + "\t");
                    strFileContents.Append(row["FullName"] + "\t");
                    strFileContents.Append(row["Phone"] + "\t");
                    strFileContents.Append(row["Company"] + "\t");
                    strFileContents.Append(row["Address"] + "\t");
                    strFileContents.Append("\n");
                }
            }
            sw = System.IO.File.CreateText(FilePath);
            sw.Write(ISpace.CommLive.UI.User.CommonFunctions.StripHTMLTags(strFileContents.ToString()));
            sw.Close();
        }
</code></pre>

<p>Thanks,
Jagadi</p>
