Data Grid and DateTime Values From SQL Server

  • Thread starter Thread starter Jonesgj
  • Start date Start date
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
 
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
 
Back
Top