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?

enter image description here

thank hope answer

you need set dropdownlist.datatextformatstring "{0:yyyy/mm/dd}".

<asp:dropdownlist id="dropdownlist1"     ...     datatextformatstring="{0:yyyy/mm/dd}"/> 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -