Time Zone Problem in Web Service

J

John

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top