473,513 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Format columns in datagridview VB.net 2005


I have a datagridview in vb.net 2005 that pulls its data from an Access
Database. The database has a time column. When you view the data in Access
it shows only a time in 24hour format. When the same column is displayed in
the datagridview, it displays a date and time. I assume the date is a
default date as all 4000+ records display the same date in 1899. How do I
format the column to show only the time?

Thanks,

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
1 7562
fourlaugh
1 New Member
Try as follows
CDate("DateField").tostring("t") for time only
CDate("DateField").tostring("d") for date only
May 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1791
by: Rob | last post by:
Dear All, I am having a few issues with DataGridViews. Here is what I have. In a windows form I have added a DataGridView. My data is stored in an array of instances of a class with several...
2
1440
by: ORC | last post by:
The string format of a com port when opening a port in win32 API is "COM1:" but how is it in VS 2005 in the System.IO.Ports.SerialPort.PortName property (with or without the ':' character) ? ...
2
16815
by: Scott M. Lyon | last post by:
I currently am working on a VB.NET application that imports data from an Excel spreadsheet that the customer filled in. I used the following code to use ODBC to read the data from the...
5
21299
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
1
1065
by: ClearConcepts | last post by:
Hi, I'm working on vb.net.Can anyone tell, how to format the datagridview column to enter only time(hh:mm am/pm) format Thanks, -- Regards ClearConcepts
4
18698
by: shibeta | last post by:
Hello, I have problem with DataGridView and BindingSource. I have created DataSet and added TableData to it with manualy created columns (without DataAdapter - I'm not using MSSQL). On the Form I...
1
2761
by: kudzu | last post by:
I'm new to SQL Server 2005 and have a question. I have a table with the following format: Columns: ID Col_A Col_B Col_C Col_D .... (Col_X) Values: 1 Yes ...
0
1473
by: Don Miller | last post by:
I'd like to use a programmatically bound GridView to display a dataset (or work with a datareader) that may include everchanging numbers of database columns, in unpredictable order, with varying...
2
7119
by: DeelynBaNi | last post by:
Hi all...i'm having a problem in formatting columns in excel. For example i have column Name, Birth Date and Salary and i want to format it to string, date and numeric respectively. When i format the...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.