Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2006, 12:38 PM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Time format

Hi people

Attempt to edit time format, sql express by default takes in and displays us format, not the uk one.

I formated appearance of the calendar and the text box as follows:

    Calendar1.SelectedDate = Calendar1.TodaysDate
        HiddenField1.Value = Format(Calendar1.TodaysDate, "dd,MM,yyyy")

    Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        txtDate.Text = Format(Calendar1.SelectedDate, "dd/MM/yyyy")


will that suffice and will the server return the error? Hypothetical question as I did not get my insert working yet! Stuffed!!!

Also, how the grid time appearance may be formated to the same standard?


thanx fellas, a valuable forum
mdm

 
Old April 7th, 2006, 11:59 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You have to change the fomat in the gridview's RowDataBound event:
Ex:


    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim mydate As DateTime
            Dim mystring As String
            mydate = e.Row.Cells(3).Text
            mystring = mydate.ToString("dd/MM/yyyy")
            e.Row.Cells(3).Text = mystring
        End If
    End Sub

Jim

 
Old July 12th, 2006, 10:37 AM
MDM MDM is offline
Authorized User
 
Join Date: Mar 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Jim, would the same work for details view? I have tried to implement that for a details view and it did not like it.

thank you

mdm






Similar Threads
Thread Thread Starter Forum Replies Last Post
Format Execution time baaul Reporting Services 2 February 3rd, 2015 04:18 PM
date time format vb certified Pro VB 6 4 December 18th, 2009 08:16 AM
Time format problem in userform frankjuel Excel VBA 1 October 10th, 2007 08:34 AM
Using xs:time to generate time in desired format krayan001 XSLT 0 June 27th, 2005 04:28 PM
Format Date Time ganesh15 PHP How-To 2 August 20th, 2003 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.