I am exporting data from the DB to excel in C# and it has a phone number column eg +22200073886. How do I Export to excel without converting the number to scientific notation?
var csv = new StringBuilder();
string strContent = "";
int counter = DS.Tables[0].Columns.Count;
// Build the file content
for (int i = 0; i <= DS.Tables[0].Rows.Count; i++)
{
for (int j = 0; j < counter; j++)
{
if (i == 0)
{
strContent += DS.Tables[0].Columns[j].ToString() + ",";
}
else
{
strContent += DS.Tables[0].Rows[i - 1][j].ToString() + ",";
}
}
csv.AppendLine(strContent.Substring(0, strContent.Length - 1));
strContent = "";
}
File.WriteAllText(new Page().Server.MapPath(filePath), csv.ToString());