Data Grid and DateTime Values From SQL Server

J

Jonesgj

Hi,

I have connected to a SQL Server table using dataAdapter/Dataset to fill a
data grid. On SQL Server a column is a DateTime datatype (its actually a
'LastLogon' column ) and has both Date and Time. However, when I retrieve
the records in the data grid, only the date portion is shown. I can't see
what I'm doing wrong.

I followed Chapter 10 of the Coding Techniques for MS VB.NET which is a step
by step tutorial, and everything works - data retrieval and updating, but no
time is displayed.

Incidentally - I can see the correct data in Ent Manager and Query analyser
i.e Date and Time.


Any help appreciated.

Kind regards

JonesG
 
W

W.G. Ryan eMVP

You may want to try Adding a DataGridTableStyle and then a
DataGridColumnStyle - you can formate the columns however you want from
there. Also, I'd verify the column values locally in the debugger and make
sure I'm getting the datetime back but I really don't think that's the
problem.

Cheers,

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top