Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
i Have a GridView in my Page
in Grid i Have a column that save Time
i have saved the time in this type : varchar2(4)

when i loan the page , the time doesnt show
but it has in database
it has in may query

plz help me
thnx

[EDIT]
I use c#

HTML
<asp:TemplateField HeaderText="V_TIME_PERIOD"
                         HeaderStyle-Font-Bold="false" HeaderStyle-ForeColor="DarkOrange">
                         <insertitemtemplate>
                             <cc1:TimePicker ID="tp_time_period"  runat="server" AMDesignator='<%#DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD").ToString()%>'
                                 Direction="RighToLeft" TextValue="00:00:00" Width="150px" />                            </insertitemtemplate>
                         <edititemtemplate>
                             <cc1:TimePicker ID="tp_time_period"  runat="server" AMDesignator='<%#DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD").ToString()%>'
                                 Direction="RighToLeft" TextValue="00:00:00" Width="150px" />
                         </edititemtemplate>
                         <itemtemplate>
                             <cc1:TimePicker ID="tp_time_period"  runat="server" AMDesignator='<%#DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD").ToString()%>'
                                 Direction="RighToLeft" TextValue="00:00:00" Width="150px" />
                         </itemtemplate>
                         <HeaderStyle Font-Bold="False" ForeColor="DarkOrange" />
Posted
Updated 17-Aug-15 13:56pm
v3
Comments
Wendelius 17-Aug-15 3:25am    
What code do you have?
sns60 17-Aug-15 3:32am    
---content has been moved to the question---
Sergey Alexandrovich Kryukov 17-Aug-15 20:12pm    
Don't use varchar instead of proper time types.
—SA
Prashant Kothale 18-Aug-15 1:05am    
Try:
Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD"))
instead of
DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD").ToString()
sns60 18-Aug-15 1:23am    
hi
i tried this
Try:
Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD"))
instead of
DataBinder.Eval(Container.DataItem, "V_TIME_PERIOD").ToString()

but i get this error :
string was not recognized as a valid datetime

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900