Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 21st, 2003, 02:03 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using a datagrid with Access D/B Time fields

I am using an Access Database and populating a Datagrid. I have 2 time fields in the database. They use the date/time format in the database. When displayed in the grid, they show up with 12/30/1899 preceeding the time. Then I changed the database to use short times. The same thing occurred. Is there a problem with a datagrid where it always shows this date in the time field? Here is the code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not IsPostBack Then
            OleDbConnection1.Open()
            Dim reader As System.Data.OleDb.OleDbDataReader
            reader = OleDbCommand1.ExecuteReader
            DataGrid1.DataSource = reader
            DataGrid1.DataBind()
            reader.Close()
            OleDbConnection1.Close()



        End If


    End Sub

Thanks for any help with this.
Reply With Quote
  #2 (permalink)  
Old June 22nd, 2003, 04:14 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I dont think its a problem.

I think that the default date is probably stored the same way in the database as it previously was, its just the format that the field is displayed that has changed.

I could be wrong about that, but it will be quite easy to format the column on the datagrid to display the date in a certain format regardless of how the date is stored, as long as its a valid date.

hth
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SELECTING CERTAIN FIELDS IN A DATAGRID??? twyce General .NET 1 November 14th, 2008 02:22 PM
subtracting two time mysql fields in php fochu PHP Databases 0 September 13th, 2006 08:17 AM
Adding Time Fields Brendan Bartley Access 3 July 30th, 2006 08:35 PM
comparing date/time fields on form validation Lucy Javascript How-To 1 June 20th, 2006 09:22 AM
setting date/time fields back to null value badgolfer Access 1 August 8th, 2005 02:29 AM



All times are GMT -4. The time now is 06:28 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.