473,789 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DataI n
2. I've chanded the DS schema to Date
3. Access Format for column says: mm/dd/yyyy

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

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutp ut.Text = myDateTime.ToSt ring("dddd MMMM dd hh:mm:ss");

this.txtBoxOutp ut.Text = myDateTime.ToSt ring("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****@discuss ions.microsoft. com> wrote in message
news:6E******** *************** ***********@mic rosoft.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.DataI n
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.ToSh ortDateString() ;

"MikeY" wrote:
Hi Steve,

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutp ut.Text = myDateTime.ToSt ring("dddd MMMM dd hh:mm:ss");

this.txtBoxOutp ut.Text = myDateTime.ToSt ring("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****@discuss ions.microsoft. com> wrote in message
news:6E******** *************** ***********@mic rosoft.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.DataI n
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.DataI n). 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.DataI n (mm/dd/yyyy)


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

"MikeY" wrote:
Hi Steve,

Hope this exerpt from my code helps.

public void SetTime()

{

DateTime myDateTime = DateTime.Now;

// this.txtBoxOutp ut.Text = myDateTime.ToSt ring("dddd MMMM dd hh:mm:ss");

this.txtBoxOutp ut.Text = myDateTime.ToSt ring("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****@discuss ions.microsoft. com> wrote in message
news:6E******** *************** ***********@mic rosoft.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.DataI n
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
6169
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 then appends the data to a dataset that is built in the Page_Load code in the if(!isPostBack) block. When I try to add a row in the button click event code I get an error saying that "Object reference not set to an instance of an object". I'm...
2
3806
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 one text box control. When the user makes changes, the first character change in the text box will not set the underlying DataSet.HasChanges to true. Only the subsequent character change sets the DataSet.HasChanges to true. Why is that? More...
2
4828
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 row selected in the datagrid. I want to save the changes that user make in the textboxes when they select a different row in the datagrid. I tried capturing the textbox.text at datagrid's CurrentCellChanged event but by then the textbox.text...
1
1410
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. Part of my code takes the form: ds.tables(0).rows(0)("FirstName") = Firstname.Text
4
2582
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 be some way to force the edited TextBox to update the DataSet since it appears to not be done automatically. //-------------------------------------------------------------------------- -------------------------- private void Page_Load(object...
1
1834
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 grid and edit them. But I don't know how to save the data back to the database when the user clicks on a Button. Thanks. private void Page_Load(object sender, System.EventArgs e) {
3
17765
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 of one of the Dataset columns. If I set set the binding properties using the properties window, this isn't successfull since the textbox attempts to bind at page_load, at which time the dataset is not filled. How can I use VB code to specify...
5
1506
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 created the oledbadapter and successfully created the dataset object. The table in the mdb is tbl1. I named tbl1 as dtTbl1 in the dataset object ds1 and a field called fld1 as dcfld1. I can loop through the dataset and see my data in the console...
2
1172
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 configured database files. (The only difference in the tables is their name and keyfield name.) Hmmm, I though, a perfect candidate for trying our Visual Inheritance for the first time. ARGHHHHHHH! What have I gotten myself into? Here's the...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6769
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
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 we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.