从数据表导出到Excel的问题 [英] Problem on Export to excel from data table
本文介绍了从数据表导出到Excel的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hai to all,
我在将数据从excel导出到数据表时遇到问题。在我的Excel工作表中,我有3列,如1,2,3,这些列包含像12.30这样的分数。如果我从excel检索数据到数据表,它正确地显示数据,如12.30的1和3列,但它不会显示分数中的第二列数据,它显示第二列数据,如12.3。特定列2上缺少0。请给我任何建议。
解决方案
如果你在datagridview中显示数据你可以使用这样的东西
DefaultCellStyle.Format()= 。00
Hai to all,
I have a problem on Export data from excel to a data table. In my excel sheet i have 3 columns like 1,2,3, these columns are contains the fraction numbers like 12.30. If i retrieve data from excel to data table it shows the data correctly like 12.30 for 1 and 3 columns but it wont show the 2 nd column data in fraction number it shows the 2nd column data like 12.3. the "0" is missing on a particular column "2". any suggestions please.
解决方案
If you are displaying the data in a datagridview you can use something like this
DefaultCellStyle.Format() = ".00"
这篇关于从数据表导出到Excel的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文