[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Date and Time

Posted on 2006-04-10
9
Medium Priority
?
163 Views
Last Modified: 2012-05-05
I have a table, which one of the columns, name "Attempt" on my database. It keeps a record of failure login. It does stamp the date and time on the column.  When I fill it on my datagrid, VB.net program. it shows only the date. Could you help to find the soulution?
0
Comment
Question by:VBdotnet2005
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16419109
1) .NET version?
2) Assuming WinForms, but need to make sure.  WinForms or ASP.NET?

Bob
0
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 16419202
How are you pulling in the data?
How is your datagridcolumn formatted?
0
 
LVL 35

Expert Comment

by:YZlat
ID: 16419415
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:VBdotnet2005
ID: 16419571
vb.net , WindFormn, Datagrid
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16419585
Yep, I was looking at:

Dim column As New DataGridTextBoxColumn()
column.MappingName = "CurrentDate"
column.HeaderText = "Date"
column.Format = "MM/dd/yyyy hh:mm:ss"

Bob
0
 

Author Comment

by:VBdotnet2005
ID: 16419689
Bob, like this ? I got Null on this column.


    Private Sub DataGrid1_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles DataGrid1.Navigate
        Dim column As New DataGridTextBoxColumn
        column.MappingName = "CurrentDate"
        column.HeaderText = "Date"
        column.Format = "MM/dd/yyyy hh:mm:ss"
    End Sub
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16419700
No, read that article from YZlat, and see how to apply DataGrid table styles.

Bob
0
 
LVL 2

Accepted Solution

by:
manojkumarps earned 1000 total points
ID: 16423961
Hello VBdotnet2005,
    Before pulling the data from the DB you design the datagrid with repect to the tablestyles.
As you know which is the column that will be containing the date in your specified format. Assign the format of the date in the tablestyles itself so that you need not validate the dates after getting it in a dataset or datatable.
 The format can be assigned to the coloumn by using the following code.
        column.format = "dd/MM/yyyy hh:mm:ss"
 Add the tablestyles to the datagrid.
This should solve your problem.

Regards,
manoj
0
 
LVL 2

Expert Comment

by:manojkumarps
ID: 16433334
Hello VBdotnet2005,
        Thank you for the grading and points.

Regards,
Manoj
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month18 days, 17 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question