Date and Time

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?
VBdotnet2005Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
1) .NET version?
2) Assuming WinForms, but need to make sure.  WinForms or ASP.NET?

Bob
0
Brian CroweDatabase AdministratorCommented:
How are you pulling in the data?
How is your datagridcolumn formatted?
0
YZlatCommented:
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

VBdotnet2005Author Commented:
vb.net , WindFormn, Datagrid
0
Bob LearnedCommented:
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
VBdotnet2005Author Commented:
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
Bob LearnedCommented:
No, read that article from YZlat, and see how to apply DataGrid table styles.

Bob
0
manojkumarpsCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
manojkumarpsCommented:
Hello VBdotnet2005,
        Thank you for the grading and points.

Regards,
Manoj
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.