开发者

Column fromate problem while reading Excel in c#

I am able to read the excel sheet from c# + asp.net application with MS interop Excel services (namespace). Data retrieving fine. But my excel sheet have a colummn whose formate type is of hh:mm:ss type. while retriving data i found value of this column fetching as开发者_Go百科 General column getting some 0.45645646... like value. What should this problem is. rewind that in Excel sheet column formate is Custom as hh:mm:ss type as per requirement. Please guide .


Your question is not clear.

Do you want to set the number format to "hh:mm:ss"? If so you can do:

worksheet.Cells["A1"].NumberFormat = "hh:mm:ss";

Do you want to get the formatted value of the cell as a string?

string formattedValue = worksheet.Cells["A1"].Text;

If it is something else, please try to make your question clearer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜