problem getting short time from an MS access database

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jun 2009
Posts: 20
Reputation: ejazmusavi is an unknown quantity at this point 
Solved Threads: 0
ejazmusavi ejazmusavi is offline Offline
Newbie Poster

problem getting short time from an MS access database

 
0
  #1
Jun 19th, 2009
Hi
Every one.
I have an MS access database table in which i have stored a data type of date/time in short time format.
When i access the table from c# and diplay it into a data grid view the column in short time format diplay as long time format
i.e, i have stored (10:10) in data base table but in c# it display like (16/06/2009.10:10:00 AM) in data gridview
how i can get the only short time from this table?
Please any one to help me.......
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 268
Reputation: Traicey is an unknown quantity at this point 
Solved Threads: 19
Traicey's Avatar
Traicey Traicey is offline Offline
Posting Whiz in Training

Re: problem getting short time from an MS access database

 
0
  #2
Jun 19th, 2009
I think you might wana consider having something like this txtDate.Text = DateTime.Today.ToShortTimeString();
in ur code, its hard to tell coz u havent post any code to see where u might be going wrong

the code above will display in a text box "12:00 AM", u can also omit AM if u want to
Last edited by Traicey; Jun 19th, 2009 at 5:42 am.
Some people get so rich they lose all respect for humanity. That's how rich I want to be.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,612
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 463
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: problem getting short time from an MS access database

 
0
  #3
Jun 19th, 2009
Use DefaultCellStyle.Format property.
I presume that the column number 3rd is of date datatype.
  1. dataGridView1.Columns[2].DefaultCellStyle.Format = "HH:mm:ss";
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 20
Reputation: ejazmusavi is an unknown quantity at this point 
Solved Threads: 0
ejazmusavi ejazmusavi is offline Offline
Newbie Poster

Re: problem getting short time from an MS access database

 
0
  #4
Jun 19th, 2009
Thank You very much that was the exact solution of my problem
once again thank you
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,612
Reputation: adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of adatapost has much to be proud of 
Solved Threads: 463
Moderator
adatapost's Avatar
adatapost adatapost is offline Offline
Posting Maven

Re: problem getting short time from an MS access database

 
0
  #5
Jun 19th, 2009
Thanks.
Please mark this Thread as Solved If you got suitable solution.
Failure is not fatal, but failure to change might be. - John Wooden
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC