Date format is not changing

Discussion in 'ASP .Net' started by CreativeMind, May 16, 2008.

  1. CreativeMind

    CreativeMind Guest

    hi all, i m using these lines of code in my program. but when i
    deploy , the live server machine doesn't change date format.

    IFormatProvider culture=new CultureInfo("en-GB",true);

    string a=string.Empty;

    DateTime FromEntryDate=Convert.ToDateTime("01/01/1900");

    if( txtStartEntryDate.Text.Trim()!=""){
    a=txtStartEntryDate.Text;
    FromEntryDate =
    DateTime.Parse(a,culture,DateTimeStyles.NoCurrentDateDefault);
    //
    FromEntryDate=DateTime.Parse(FromEntryDate.ToString("MM/dd/yyyy"), new
    CultureInfo("en-US").DateTimeFormat);
    }

    strSQL = string.Format("exec spSearchProperties @RefNo ='{0}',
    @OwnerName = '{1}',@LocationId={2},@ProjectId
    ={3},@SortofId={4},@SellingAgentId={5},@Status='{6}',@StartEntryDate='{7}'",
    RefNo,OwnerName.ToString().Trim(),
    LocationId, ProjectId, UnitTypeId,this.cboSellingAgent.SelectedValue,
    Status,FromEntryDate.ToString("MM/dd/yyyy"));

    objDAM.GetDataTable(strSQL,CommandType.Text, ref table);

    Trace.Warn(strSQL);

    --------------------

    trace.warn gives following out put which is working fine but on local
    server.

    exec spSearchProperties @RefNo ='', @OwnerName =
    '',@LocationId=0,@ProjectId
    =0,@SortofId=0,@SellingAgentId=0,@Status='0',@StartEntryDate='05/13/2008'

    --------------------

    but on deployment , trace.warn shows following line that is not
    required, i want to get @StartEntryDate='05/13/2008', how can i get
    that value.

    exec spSearchProperties @RefNo ='', @OwnerName =
    '',@LocationId=0,@ProjectId
    =0,@SortofId=0,@SellingAgentId=0,@Status='0',@StartEntryDate='13/05/2008
    00:00:00'
    thx
    CreativeMind, May 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shaiboy_UK
    Replies:
    0
    Views:
    479
    Shaiboy_UK
    Oct 19, 2003
  2. Gani Pola

    Changing date format

    Gani Pola, Nov 25, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    843
    Manoj G [MVP]
    Nov 25, 2003
  3. Brian Candy
    Replies:
    2
    Views:
    1,155
    Janaka
    Feb 18, 2004
  4. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,244
    Michael Borgwardt
    May 30, 2004
  5. Shaiboy_UK

    Time/Date format and changing time to GMT

    Shaiboy_UK, Oct 19, 2003, in forum: ASP General
    Replies:
    1
    Views:
    184
    Bob Barrows
    Oct 19, 2003
Loading...

Share This Page