Ask a questionAsk a question
 

QuestionTime Zone Problem in Web Service

  • Tuesday, September 26, 2006 1:49 PMAmnu cherian Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi All,

    I Am Using Vb.net and xml webservice.My Problem Is When i  Call dataset
    Using Web service  .The Date  THAT IS Getting Is Differnent That was in
    database(Sql) If I Change my Time zone.I Have Web service in The Live
    Server .And My Client Application using vb.net .If I change the Time
    Zone in Client (PDA) There Value of Data is changing.

    My Code in Web service
    <WebMethod()> _
        Public Function GetDS(ByVal strSQL As String) As DataSet
            Dim dt As New DataTable()
            Dim a(0) As String
            Dim dr As DataRow
            Try
                If conGlobal.State = ConnectionState.Closed Then
    conGlobal.Open()
                'conGlobal.Open()
                DS.Reset()
                DA = New SqlDataAdapter(strSQL, conGlobal)
                DA.Fill(DS)
                DA.Dispose()
                conGlobal.Close()
                DS.Locale =
    System.Globalization.CultureInfo.InvariantCulture
                Return DS
            Catch ex As Exception
                dt.Columns.Clear()
                dt.Columns.Add("Error")
                dr = dt.NewRow
                dr.Item("Error") = ex.Message.Trim
                dt.Rows.Add(dr)
                DS.Tables.Add(dt)
                'DS.Tables.Add("Error").Rows.Add(ex.Message.Trim)
                conGlobal.Close()
                Return DS
            End Try
        End Function

    In VB.net
     DsPR = GetDS("SpGetLastPostedDate '" & Trim(cmbExchange.Text) & "'," &
    Val(GintCompanyID) & " ")

    Acutal Data In Table is 21-10-1980 and it come as 20-10-1980 and time
    lbLastPostedDate.Text = dr.Item("TranDate") '20-10-1980 'Error

All Replies