469,917 Members | 1,701 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

DataSet Textbox Time

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 the time (e.g. 12/7/04 12:00 AM).

How do I get rid of the time from textbox and show only the date?

1. VS textbox Properties:
(DataBindings)-TextBox: fooDS - TableName.DataIn
2. I've chanded the DS schema to Date
3. Access Format for column says: mm/dd/yyyy

Steve
Nov 16 '05 #1
3 2010
Hi Steve,

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutput.Text = myDateTime.ToString("dddd MMMM dd hh:mm:ss");

this.txtBoxOutput.Text = myDateTime.ToString("dddd");

}

For the blocked out part of the code, you can see that you can manipulate
the desired part of the time/date/etc that you want.

MikeY
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
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 the time (e.g. 12/7/04 12:00 AM).

How do I get rid of the time from textbox and show only the date?

1. VS textbox Properties:
(DataBindings)-TextBox: fooDS - TableName.DataIn
2. I've chanded the DS schema to Date
3. Access Format for column says: mm/dd/yyyy

Steve

Nov 16 '05 #2
I think you might also be able to use something like
myDateTime.ToShortDateString();

"MikeY" wrote:
Hi Steve,

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutput.Text = myDateTime.ToString("dddd MMMM dd hh:mm:ss");

this.txtBoxOutput.Text = myDateTime.ToString("dddd");

}

For the blocked out part of the code, you can see that you can manipulate
the desired part of the time/date/etc that you want.

MikeY
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
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 the time (e.g. 12/7/04 12:00 AM).

How do I get rid of the time from textbox and show only the date?

1. VS textbox Properties:
(DataBindings)-TextBox: fooDS - TableName.DataIn
2. I've chanded the DS schema to Date
3. Access Format for column says: mm/dd/yyyy

Steve


Nov 16 '05 #3
Thank you but the problem is the TextBox (TB) is filled by the DataSet (DS)
field (it's not a stand alone TB).

The DataGrid is fiilled by a fooDS. The TB (physically separate from DG but
on the same form) is filled by the DataIn column of the fooDS (i.e. fooDS -
TableName.DataIn). The fooDS properly displays the date in the DG but, the
TB contains the date (thats in the DG) and a base time.

How do I get rid of the base time from the TB?

What I what to do is something like: fooDS - TableName.DataIn (mm/dd/yyyy)


"Malcolm" wrote:
I think you might also be able to use something like
myDateTime.ToShortDateString();

"MikeY" wrote:
Hi Steve,

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutput.Text = myDateTime.ToString("dddd MMMM dd hh:mm:ss");

this.txtBoxOutput.Text = myDateTime.ToString("dddd");

}

For the blocked out part of the code, you can see that you can manipulate
the desired part of the time/date/etc that you want.

MikeY
"Steve B." <St****@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
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 the time (e.g. 12/7/04 12:00 AM).

How do I get rid of the time from textbox and show only the date?

1. VS textbox Properties:
(DataBindings)-TextBox: fooDS - TableName.DataIn
2. I've chanded the DS schema to Date
3. Access Format for column says: mm/dd/yyyy

Steve


Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Paul Aspinall | last post: by
1 post views Thread by Nikhil Patel | last post: by
3 posts views Thread by MrMike | last post: by
2 posts views Thread by Gary Shell | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.