asp.net mvc - Cell formating in csv -
i exporting generated serial code in 3 formats (with c# asp.net mvc): .txt, .csv , .xls. thing in .txt , .xls code in right format. in .csv loses leading 0 if starts 0 , example:
183531982165
is shown like
1,83532e+11
this code snipped use fill file:
public static byte[] createfile(sericalcodemodel scobj, mydb db) { using (system.io.filestream fs = new system.io.file.create(filepath)) { using (system.io.textwriter wr = new system.io.streamwriter(fs)) { list<list<string>> filelines = db.get<serialcode>().getserialcodeoutdatatofile(scobj); // db records foreach (list<string> fileline in filelines) { wr.writeline(string.join(";", fileline)); } } } }
this error occurs when open file excel, otherwise, other editor notepad shown how is!
why , how can fix error?
Comments
Post a Comment