473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Remove time part from datetime in bound label control

aaa
Hi

I am trying to bind Text property of label control to datetime object
(attribute from typed dataset). The problem is that I want only to show
date part. Currently I use following code:

this.dv = new DataView(this.ds.Person);
this.labelBirth.DataBindings.Add("Text", this.dv, "BirthdayDate");

When I do this, the text shown is, for example,

12.10.1990 13:25:34

What is the way to format the binded text to show only date part?

12.10.1990

Nov 16 '05 #1
1 11795
If time is really not important, (I dunno if there is an easy way to do
this) I would manually update the Text property of the bound textbox perhaps
on a TextChanged event to display just the shortdatestring format of the
birthdate (datetime.ToShortDateString()).

One of the reasons why I hate databindings...

<aa*@bbb.hr> wrote in message news:ch**********@garrison.globalnet.hr...
Hi

I am trying to bind Text property of label control to datetime object
(attribute from typed dataset). The problem is that I want only to show
date part. Currently I use following code:

this.dv = new DataView(this.ds.Person);
this.labelBirth.DataBindings.Add("Text", this.dv, "BirthdayDate");

When I do this, the text shown is, for example,

12.10.1990 13:25:34

What is the way to format the binded text to show only date part?

12.10.1990

Nov 16 '05 #2

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

Similar topics

17
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the...
5
by: sandman | last post by:
I've been testing my web app on another workstation to simulate using the server time. The test pc's time is an hour behind the server time and when the user processes a request, the server time...
3
by: Steve B. | last post by:
Using: VS dB: MS-Access Although the the DataGrid displays the proper date from an Access file (Date/Time DataType) an adjacent bound textbox for that same DataGrid field displays the date and...
5
by: I am Sam | last post by:
I have created this DateTime object and instanced it I think correctly DateTime myClubNow1=new...
7
by: Dick | last post by:
I have a long list of events. I know where each event took place (globally) and when (using the event’s local time). I want to do some comparisons between these date/times. I thought I would...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
11
by: Matt F | last post by:
I'm trying to do something that seems like it should be pretty simple, but haven't found a solution. I am trying to add a datacolumn to a datatable that adds or subtracts a number of days based on...
0
by: =?Utf-8?B?RyBIdXN0aXM=?= | last post by:
I am binding a date/time value from an Access database thru a datatable/dataview to a label on a VB2005 form, it's bound like this: lblDOB_CH.DataBindings.Add("Text", dvMembers_CH, "DOB") I want...
3
by: Allen Chen [MSFT] | last post by:
Hi Richard, Quote from Richard================================================== However I also want to be able to remove the panes. I have tried to include this, but find that when I first...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.