473,404 Members | 2,178 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,404 software developers and data experts.

datagridview displays 4 digit yrs on cmptr1 and 2 digit yrs on cmp

Using VB2005, a datagridview is displaying the dates with 4 digit years on
one workstation but displays the dates of the exact same records with only 2
digit years on a 2nd workstation. I will guess that it may be an environment
setting on the other workstation. But how can I make the datagridview
display the dates in the same format consistently for all workstations?

The data is coming from a sql Server 2000 table.

Select * from tbl1
dataAdapter.Fill(dataset1, "tbl1")

dataview1 = dataset1.Tables("tbl1")
dataview1.sort = "FirstName"
datagridview1.datasource= dataview1

how can I force datagridview1 to display all date values with 4 digit years?

Thanks,
Rich
Feb 19 '08 #1
2 1296
Incase anyone cares - here is how to force a date format in the datagridview

datagridview1.Columns("date1").DefaultCellStyle.Fo rmat = "MM/dd/yyyy"
Note: I believe that the month portion needs to be upper case M's for
VS2005 to recognize it as a Month param.
"Rich" wrote:
Using VB2005, a datagridview is displaying the dates with 4 digit years on
one workstation but displays the dates of the exact same records with only 2
digit years on a 2nd workstation. I will guess that it may be an environment
setting on the other workstation. But how can I make the datagridview
display the dates in the same format consistently for all workstations?

The data is coming from a sql Server 2000 table.

Select * from tbl1
dataAdapter.Fill(dataset1, "tbl1")

dataview1 = dataset1.Tables("tbl1")
dataview1.sort = "FirstName"
datagridview1.datasource= dataview1

how can I force datagridview1 to display all date values with 4 digit years?

Thanks,
Rich
Feb 19 '08 #2
Rich,
>
Note: I believe that the month portion needs to be upper case M's for
VS2005 to recognize it as a Month param.
As is for years standard, because lower case mm stands for minutes.

Cor
Feb 20 '08 #3

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

Similar topics

7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
130
by: Daniel Manes | last post by:
I'm baffled. I have a column in a SQL Server Express database called "Longitude," which is a float. When I view the table in a DataGridView, some of the numbers, which only have two decimal places...
2
by: Steve Richter | last post by:
what is the best way to use DataGridView to view data from large database tables? Where the sql select statement might return millions of rows? string connectionString =...
1
by: trint | last post by:
Hello professionals, I have a datagridview that displays columns based upon my sql select statement. I have additional columns that I want displayed in the datagridview I wish to append to the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.