c# - How to remove time format from dropdownlist ASP.NET -
i have dropdownlist populated database date value. in database type data 'date' not time, dropdownlist loaded time format
dim da = new sqldataadapter("select distinct tahun_lulus_kuliah alumni", conn) dim ds = new dataset ds.clear() da.fill(ds, "alumni") dropdownlist1.datasource = ds.tables("alumni") dropdownlist1.datavaluefield = ("tahun_lulus_kuliah") dropdownlist1.databind()
this screenshoot of dropdownlist, , it's possible change format dropdownlist become "yyyy/mm/dd" without time format?
thank hope answer
you need set dropdownlist.datatextformatstring
"{0:yyyy/mm/dd}"
.
<asp:dropdownlist id="dropdownlist1" ... datatextformatstring="{0:yyyy/mm/dd}"/>
Comments
Post a Comment