【发布时间】:2013-05-16 07:04:18
【问题描述】:
我的数据库中有这样的数值,
14192555.00
当我得到它并将其放入文本框并将其转换为字符串时,
this.txtPriorNYSDOTRating.Text = ds.Tables[0].Rows[0]["Fact2A_PriorNYSDOTPerfRatingScore"].ToString();
14192555.0000
我也尝试过格式化,
this.txtPriorNYSDOTRating.Text = ds.Tables[0].Rows[0]["Fact2A_PriorNYSDOTPerfRatingScore"].ToString("0.####");
导致错误“no overload for method string”
希望您的建议提前谢谢
已编辑:
我在数据库中有日期,例如,
2010-10-19 00:00:00.000
我明白了,
10/19/2010 12:00:00 AM
我的代码是,
this.txtDesignatedDate.Text =Convert.ToDateTime(ds.Tables[0].Rows[0]["DesignatedDate"]).ToString();
如何将其格式化为仅获取 `"10/19/2010"
希望得到您的回复
【问题讨论】:
标签: c# asp.net formatting decimal