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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Hemant SrivastavaRank #581 · 4.2K reputationPosted Mar 5, 2013, 4:34 PM EST
textBox1.Text = Convert.ToDateTime(dt).ToShortDateString();
where dt is your data value from Oracle Db
sita k41 reputationPosted Mar 5, 2013, 6:23 PM EST
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();
Vishal GilbileRank #268 · 9.4K reputationPosted Mar 5, 2013, 8:44 PM EST
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.
Hemant SrivastavaRank #581 · 4.2K reputationPosted Mar 6, 2013, 1:12 PM EST
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.