listbox

fefzdv

New Member
This is the code I have.<BR><BR><asp:listbox id="lstDepartments" runat="server" Rows="1" <BR> DataTextField="HitDate" DataValueField="HitDate" /><BR><BR>I bind the listbox with this code.<BR><BR>lstDepartments.DataSource = ds.Tables("PageStats2").DefaultView<BR> lstDepartments.DataBind()<BR><BR><BR><BR>When I run the code it adds 12:00:00 AM to the date in the dropdown. Is there a way where I can display the date in ##/##/## format. In the the database it is the format of ##/##/##.<BR><BR><BR>BillTry the following :<BR><BR><asp:listbox id="lstDepartments" runat="server" Rows="1" <BR> DataTextField="HitDate" DataValueField="HitDate" <BR>DateTextFormatString="{0:MM/dd/YY}"<BR>/> <BR><BR>
 
Back
Top