Datetime field in Data grid not displaying time

  • Thread starter Thread starter Tony Murnion
  • Start date Start date
T

Tony Murnion

In vb.net, I have set up a connection to a SQL server using the
sqldataadapter, a SQLconnection, a dataset, and a datagrid to display the
dataset. When I display the grid, the DateTime field in the grid only shows
the date. How do I get it to display both the date and time?

Thanks in advance

Tony
 
Hi,

Convert The DateTime filed to string and bind the column.
It will display as per your requirement.

Hope this will resolve your problem.
 
it is simple, do a format of the cell as format {0:D} in the datagrid or
search for the format you like using format specifiers in vb.net for date
i.e. look for string.format()
 

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

Back
Top