473,626 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text Format String - Please help

Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
of '04/10/2001'. I know I didn't do it right. Please let me know what's the
correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy
Nov 17 '05 #1
7 7655
make sure ur page Culture is set right
"Eddy Soeparmin" <es********@cli entprofiles.com > wrote in message
news:ud******** ******@TK2MSFTN GP11.phx.gbl...
Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
of '04/10/2001'. I know I didn't do it right. Please let me know what's the correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy

Nov 17 '05 #2
Hi Vincent,
make sure ur page Culture is set right I don't really understand what you mean by that, would you please explain
more specific in detail? I'm very new in this area. Is there something that
I have to do in VS.Net? or IE? Please advice.

Thanks.

"Vincent V" <vincentv@-n0-5pam-optushome.com.a u> wrote in message
news:O6******** *****@tk2msftng p13.phx.gbl... make sure ur page Culture is set right
"Eddy Soeparmin" <es********@cli entprofiles.com > wrote in message
news:ud******** ******@TK2MSFTN GP11.phx.gbl...
Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead of '04/10/2001'. I know I didn't do it right. Please let me know what's

the
correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy


Nov 17 '05 #3
Eddy,

I found myself having this problem the other day and
couldn't find any documentation in the MSDN other than for
numbers. Here is what you need to put in the format
string:

{0:mm/dd/yyyy}

Also,

http://asp.net/ is a really good site for anything related
to ASP .NET or .NET in general. The people in the Forums
there are very helpful and usually can answer my questions
within an hour.
-----Original Message-----
Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. OnmyGrid1 - Properties - Columns - myColumn1 - Text format string:
I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in steadof '04/10/2001'. I know I didn't do it right. Please let me know what's thecorrect way to display a 'mm/dd/yyyy' format for a DateTime coulmn.
Thanks.

Eddy
.

Nov 17 '05 #4
Vincent,
Try using the format "{0:MM/dd/yyyy}". Also, check the Help section within
the DataGrid Property Builder dialog box. It will provide you with more
information about the format modifiers.

Charlie Nilsson [msft]
Visual Studio Update

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "Eddy Soeparmin" <es********@cli entprofiles.com >
Subject: Text Format String - Please help
Date: Fri, 11 Jul 2003 11:03:09 -0400
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ud************ **@TK2MSFTNGP11 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bel lsouth.net 65.83.137.202 Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1585 58
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
of '04/10/2001'. I know I didn't do it right. Please let me know what's the correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy


Nov 17 '05 #5
Thanks Brian, Charlie,

When applying that format, it displays 00/09/1999 instead of 07/09/1999. I
will look at the http://asp.net/ and DataGrid Property Builder dialog box.

Eddy

"Charlie Nilsson [MSFT]" <Ch************ ********@hotmai l.com> wrote in
message news:N6******** ******@cpmsftng xa06.phx.gbl...
Vincent,
Try using the format "{0:MM/dd/yyyy}". Also, check the Help section within the DataGrid Property Builder dialog box. It will provide you with more
information about the format modifiers.

Charlie Nilsson [msft]
Visual Studio Update

--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "Eddy Soeparmin" <es********@cli entprofiles.com >
Subject: Text Format String - Please help
Date: Fri, 11 Jul 2003 11:03:09 -0400
Lines: 14
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ud************ **@TK2MSFTNGP11 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: adsl-065-083-137-202.sip.asm.bel lsouth.net

65.83.137.202
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1585 58 X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead of '04/10/2001'. I know I didn't do it right. Please let me know what's

the
correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy

Nov 17 '05 #6
Hi Brian,

I finally get it to work now. Earlier I got 00/09/1999 instead of 07/09/1999
because I'm using {0:mm/dd/yyyy}. It's case sensitive, and it must be
{0:MM/dd/yyyy}.

Thanks.

Eddy

"Brian Smith" <sm****@mante ch-wva.com> wrote in message
news:07******** *************** *****@phx.gbl.. .
Eddy,

I found myself having this problem the other day and
couldn't find any documentation in the MSDN other than for
numbers. Here is what you need to put in the format
string:

{0:mm/dd/yyyy}

Also,

http://asp.net/ is a really good site for anything related
to ASP .NET or .NET in general. The people in the Forums
there are very helpful and usually can answer my questions
within an hour.
-----Original Message-----
Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a

DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format

string:

I tried to put 'mm/dd/yyyy' in there and it

displays 'mm/dd/yyyy' in stead
of '04/10/2001'. I know I didn't do it right. Please let

me know what's the
correct way to display a 'mm/dd/yyyy' format for a

DateTime coulmn.

Thanks.

Eddy
.

Nov 17 '05 #7
"Eddy Soeparmin" <es********@cli entprofiles.com > wrote in message news:<ud******* *******@TK2MSFT NGP11.phx.gbl>. ..
Hi,

I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:

I tried to put 'mm/dd/yyyy' in there and it displays 'mm/dd/yyyy' in stead
of '04/10/2001'. I know I didn't do it right. Please let me know what's the
correct way to display a 'mm/dd/yyyy' format for a DateTime coulmn.

Thanks.

Eddy


try {0:d} in the datafomatstring property

John
Nov 17 '05 #8

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

Similar topics

17
1554
by: Phill Long | last post by:
Right, ok, well I have designed a form that will display a price (22.34) in a text box, and another price in the other text box... I also have a blank text box... Now I want to add both the prices together and get a total in the bloank textbox.. I got this example off a website sumwhere.. But it does not display the decimal number, it only displays the whole number PLEASE HELP var number1 =...
4
2703
by: kalio80 | last post by:
Hi everyone I posted an enquiry earlier about using c++ code to convert text files between linux & widows. I ended up with this code: #include <iostream> #include <fstream> using namespace std; int uw(string src,string dest);
5
2176
by: Kivak Wolf | last post by:
Hey everyone, I have a textbox in my web page that is going to be used to enter an E-mail into (just plain text, no HTML). Now, this will interact with a SQL database where the contents of the textbox are sent from the SQL database to the textbox, then the user edits it, and then the text inside the textbox is sent back to the SQL database. I did it the same way as if i had used a VarChar instead of a type "text" variable in the SQL...
13
4955
by: sonald | last post by:
Hi, Can anybody tell me how to change the text delimiter in FastCSV Parser ? By default the text delimiter is double quotes(") I want to change it to anything else... say a pipe (|).. can anyone please tell me how do i go about it?
1
4945
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as the maximum length of the text (which I need) and the text format (would be ideal but can do without if need be) I have posted the code below, so please can you help!?? Thanks in advance... Sub PreserveMailMergeFormFieldsNewDoc() Dim...
9
2975
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
I want to open a text file and format it into a specific line and then apply color to a specific location of the text and then display it in a RichTextBox after all of this is done. I can do all of the above after the file is loaded into the RichTextBox, and I am trying to speed the process up by doing it in a temp file.
0
836
by: Payodhi | last post by:
Hi, I am generating text file.I have written bellow code........ Imports System.IO Dim sw As StreamWriter Dim strRecord,filenam As String Protected Sub BtnTextFile_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnTextFile.Click filenam = "c:\TextFiles\Name1\" & "Name-" & DateTime.Today.Day.ToString("00") & DateTime.Today.ToString("MMM") & DateTime.Today.Year.ToString() & DateTime.Now.Hour.ToString("00") +...
7
4424
by: staeri | last post by:
I'm populating a label with an amount like this: lblBudget.Text = Generic_database_functions.GetValue("SELECT ISNULL(Sum(Budget), 0) FROM vwPROJECTForecast") I want the amount in the label to be shown as "10.000" not "10000". How can I format the amount? I'm very grateful for help!
0
8202
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
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
8641
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
8366
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
8510
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
5575
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
4202
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2628
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
1
1812
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.