473,385 Members | 1,766 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,385 software developers and data experts.

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 2123
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
2
by: jbsound | last post by:
I have been banging my head against this one and I'm sure I'm missing something: Got a WinForms app in VB.NET with controls bound to a dataset. For the sake of this discussion, let's use just...
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
1
by: Paul Aspinall | last post by:
Hi I have built a very simple page, which takes data via TextBox controls, and updates to a Dataset. I've used the Data Access Blocks (v2), to help with functionality, and to build a DAL. ...
4
by: John Rose | last post by:
I have one databound TextBox on a page with one button. The TextBox loads the correct SQL record data but typing a new string into the Textbox fails to change the DataSet. Any ideas? There must...
1
by: Nikhil Patel | last post by:
Hi, I bind a grid to a DataView object. I lose the reference to the underlying DataTable and the DataSet in a postback. Here is the code. Page_Load works fine and I am able to see the rows in...
3
by: MrMike | last post by:
Hi. I have a dataset on my webform which I successfully fill by calling a Sub that occurs after the Page_Load. My question is - I have a textbox control which I need to populate with the contents...
5
by: Rich | last post by:
Hello, I am having a problem showing data in a form textbox which is bound to a column in a table in a dataset. I have successfully established a connection to an Access mdb, successfully...
2
by: Gary Shell | last post by:
I have jumped in to the deep end of the pool, trying out visual inheritance of a form and have run into a snag. I have the need to create a simple maintenance form for five identically...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...
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...

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.