请教个字符输出格式化的问题
我在datagrid中有如下模板列
<asp:TemplateColumn HeaderText= "时间 " SortExpression= "fbdate " HeaderStyle-HorizontalAlign= "center " HeaderStyle-Width= "124 ">
<ItemTemplate>
<asp:Label ID= "fbdate " Text= ' <%# container.dataitem( "fbdate ") %> ' runat= "server " />
</ItemTemplate>
</asp:TemplateColumn>
查询的sql为select fbdate from myinfo,fbdate为datetime型,如何在输出的datagrid中显示的日期不是2003.2.3 23:11:22,而是2003-02-03???如何控制呢??
小弟分不多,请各位大侠多多指教!!
------解决方案--------------------VS2005里面直接用 Eval( "fbdate ", "{0:d} ")就可以了