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

  • Thread starter Thread starter Rich
  • Start date Start date
R

Rich

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
 
Incase anyone cares - here is how to force a date format in the datagridview

datagridview1.Columns("date1").DefaultCellStyle.Format = "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,
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
 
Back
Top