Data Grid and DateTime Values From SQL Server

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jonesgj (g_at_btinternet.com)
Date: 09/14/04


Date: Tue, 14 Sep 2004 20:38:40 +0000 (UTC)

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



Relevant Pages

  • Re: Connecting an ASP web page to SQL Server
    ... > Im running XP Pro with SQL Server 2000 SP3 installed on my local ... > dataset, and a datagrid. ... I dont see any exceptions thrown in ... Then you must call DataBindmethod of this data grid. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: what is faster ?
    ... Are you referring to SQL Server CE? ... use the second option and ... manully fill a list view control instead of a data grid for optimal ...
    (microsoft.public.dotnet.framework.compactframework)
  • Management Studio: How to open a SqlServer Compact table?
    ... I'm investigating SqlSErver Compact Edition. ... I created a DB using Sql Server Management Studio 2005. ... How come I can't have a data grid for my SQL Server Compact tables? ...
    (microsoft.public.sqlserver.tools)
  • Re: Data Grid and DateTime Values From SQL Server
    ... You may want to try Adding a DataGridTableStyle and then a ... "Jonesgj" wrote in message ... On SQL Server a column is a DateTime datatype (its actually a ... > the records in the data grid, only the date portion is shown. ...
    (microsoft.public.dotnet.languages.vb)