Have you ever encountered this problem during the project? I will share with you today that the answers I have found online are for the gridview control, in addition, the type of the ID card number column of the DataTable is string, and the type of the ID card number column is enclosed by single quotation marks. However, I have not tried it successfully. I don't know whether it is my character or not, but today, my entire solution perfectly avoids scientific notation.
1 DataTable dt = new DataTable ();
2 dt. Columns. Add (new DataColumn ("ID card number "));
3 DataRow dr = dt. NewRow ();
4 StringBuilder sb = new StringBuilder ("= \"");
5 sb. Append ("1234567890123456789"). Append ("\"");
6 dr [0] = sb. ToString ();
7 dt. Rows. Add (dr );
8 ImportAndExport. CreateExcel (dt, "1", "11.xls ");
Hey, it's easy enough! The principle is that Excel will automatically calculate the string formula = "1234567890123456789". If you do not believe this, create an Exel file.
From wlitsoft