Hi,
How to hide the time while retrieving the date value from the oracle database in to a TextBox .I am not using Grid View.
Satya.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Mar 5, 2013, 9:34 PM
textBox1.Text = Convert.ToDateTime(dt).ToShortDateString();
where dt is your data value from Oracle Db
Hemant SrivastavaPosted Mar 6, 2013, 6:12 PM
For different type of DateTime Format, you may refer to this link:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Hope it could help you.
Vishal GilbilePosted Mar 6, 2013, 1:44 AM
To Display only date from the oracle database you can use the following example.
If i write a query like the following
My output will be
06-03-2013 12:08:18
But if i want only date to be displayed I can make use of the following query which makes use of to_char function provided by the oracle server.
To Display only time your query must be like the following
In this case your output will be like the following
06-03-2013
Hope this helps you.
sita kPosted Mar 5, 2013, 11:23 PM
Thanks for the reply.With your answer the issue got solved.What if i wanted a specific format DD-MON-YYYY.Can i use it along with Convert.ToDateTime(dt).ToShortDateString();