DotNetcr.com
Si deseas hacer un intercambio de links con DotNetcr, escríbenos aquí
Recibe las actualizaciones vía RSS
Te invitamos a unirte en nuestras redes
   http://www.facebook.com/DotNetcr
   http://www.twitter.com/dotnetcr

Conectar PocketPC a un WebService

Por royrojas | 7/22/2005 | Visitas 8,740 | Voto 0.00
En este ejemplo vamos a crear una aplicación en PocketPC que se conecte a un WebService, y desplegar datos en Label y en un Datagrid.
Categorías : WebServices, Windows Mobile
Como punto de partida vamos a utilizar un WebService gratuito que nos brinda el Banco Central de Costa Rica para consultar los tipos de cambio del día y también el historial por fechas.

En un artículo anterior explicamos este mismo webservice, ver ejemplo aquí, ya que es el mismo código, solo que a esta versión le agregaremos una funcionalidad más, que es la del historial. Con esto demostramos que es casi igual programar en PocketPC que en una aplicación para PC.

Descargar solución PocketPC_WebService.zip

Primero vamos a agregar los controles que necesitaremos para nuestra aplicación, y que esta se vea algo como esta:



El siguiente paso será agregar el siguiente código:

Imports PocketPC_WebService.bccr_tipo_cambio
....
.
Windows Form Designer generated code (esta parte la agrega .NET)
.
....

Dim iTipoCambio As New bccr_tipo_cambio.TipoCambio

Private Sub btnTraer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTraer.Click
Try
Me.lblCompra.Text = iTipoCambio.getTipoCambioCompra("Roy Rojas")
Me.lblVenta.Text = iTipoCambio.getTipoCambioVenta("Roy Rojas")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

Private Sub btnHistorial_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHistorial.Click
Try
Dim ds As New DataSet
Dim fecH As Date = Today.Date
Dim fecD As Date = Today.Date.AddMonths(-1)
If Me.rbCompra.Checked Then
ds = iTipoCambio.getTipoCambioHistorico(2, 1, _
"C", fecD.Year & "-" & fecD.Month & "-" & _
fecD.Day, fecH.Year & "-" & fecH.Month & "-" & _
fecH.Day, "Roy Rojas")
Else
ds = iTipoCambio.getTipoCambioHistorico(2, 1, _
"V", fecD.Year & "-" & fecD.Month & "-" & _
fecD.Day, fecH.Year & "-" & fecH.Month & "-" & _
fecH.Day, "Roy Rojas")
End If
Me.dgTipoCambio.DataSource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Me.lblDeHasta.Text = "De: " & _
Today.AddMonths(-1).Date.ToShortDateString & _
" Hasta: " & Today.Date.ToShortDateString
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub


El siguiente paso será ejecutar nuestra aplicacion en el emulador que nos brinda .NET, para tener un resultado como el siguiente.



Descargar solución PocketPC_WebService.zip
Area de Comentarios
Por Anónimo - Fecha: 2010/01/28 10:08 PM
alquien sabe de webservices disponibles gratuitos para obtener tipos de cambio al dolar o euro?
Por Anónimo - Fecha: 2012/04/26 04:44 AM
. These roger vivier flats are built only when xerhtjal there is sufficient demand, and usually take about three years to build. The next two BTO sales will be launched at the end of the month, for in Punggol and Sengkang. These new roger vivier flats and others in towns such as Woodlands and Bukit Panjang will make up the 5,000 new roger vivier flats the to offer in the period until September. We often romanticise the past, question today and have great expectations for the future. In the case of the roger vivier flats and the West Bank we should do none of these things. Why? Because the and the West Bank weren't always idyllic, aren't always idyllic and won't always be idyllic.Cold weather in late April and early May on Long Island has slowed down what usually is the start of fishing. However, the weather is heating up and with some luck the water will warm up soon and the bass will be hungry for those sand eels and other tasty critters that live on the roger vivier flats during the spring and early summer.There is no shame in wearing , especially when they are Burberry roger vivier flats. Not all of us have the necessary skeletal structure to spend life in five inch heels. For me, Burberry roger vivier flats were a heavenly gift from above. These are comfortable fashionable footwear that is beautifully designed.
Por Anónimo - Fecha: 2012/04/27 08:28 AM
8zcEf6 , [url=http://igebhbdzrjfv.com/]igebhbdzrjfv[/url], [link=http://ctfyqcvaqurq.com/]ctfyqcvaqurq[/link], http://qwknrxtqhsfv.com/
Por Anónimo - Fecha: 2012/04/29 12:17 AM
g9ryi3 , [url=http://yklgdddkshkz.com/]yklgdddkshkz[/url], [link=http://mmegfsugwwkg.com/]mmegfsugwwkg[/link], http://qavfqbolehfo.com/
Por Anónimo - Fecha: 2015/12/17 02:21 PM
Draq ???2012?02?21? 19:30?????????????,??????,??????????????????????,??????????????????,?????,?????????????,?????????,?????????????????????????????????????,??????2012??????,????????,???????????????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\minizip.dll??: WS.Reputation.1________________________________________________________????????? ????????? 2012/2/17 ( 12:52:03 )???? ???? ?________________________________________________________?????????????????: ??____________________________????????????____________________________?????????????____________________________??????????: ??????? ?????????????,???________________________________________________________??????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\minizip.dll???____________________________???? – SHA:e612f29d671235b5d83bc9701390d659001a22a4b43261d6e8e59d8237ceb665____________________________???? – MD5:45e651145bf7880cccb640bf8a2bf8ff____________________________????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\zlib1.dll??: WS.Reputation.1________________________________________________________????????? ????????? 2012/2/17 ( 12:52:59 )???? ???? ?________________________________________________________?????????????????: ??____________________________????????????____________________________?????????????____________________________??????????: ??????? ?????????????,???________________________________________________________??????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\zlib1.dll???____________________________???? – SHA:a25fbe3d11e9a386dd88829d1ef37b7c0b26ce2943b9734b67d7021d2c09d2c1____________________________???? – MD5:bf9275314e9dd2ef1a65e9240b7b49d7____________________________????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\libexpat.dll??: WS.Reputation.1________________________________________________________????????? ????????? 2012/2/17 ( 12:55:16 )???? ???? ?________________________________________________________?????????????????: ??____________________________????????????____________________________?????????????____________________________??????????: ??????? ?????????????,???________________________________________________________??????: c:\program files (x86)\common files\thunder nerowtk\tp\ver1\1.1.2.101_1111\libexpat.dll???____________________________???? – SHA:353e7be5cfa58f86d35cd146aef08982a807224ec67c56ab49d5de9a77ef24ed____________________________???? – MD5:91741355fd2ce25ddef5c6318769471c____________________________????????????QQ:2709****||
Por Anónimo - Fecha: 2015/12/19 02:47 AM
naam seitha thakvruaku kaaval thurai yai kurai solli enna payan. ethuvaha irunthalum namakkul pesi theerkka ella amaippum pesi mudiu seyya vendum. police idam sendraal namakkuthan nastam. ithu purinthal sari. http://cgkkwq.com [url=http://wvcgltzoq.com]wvcgltzoq[/url] [link=http://jyqkzkubr.com]jyqkzkubr[/link]
Por Anónimo - Fecha: 2015/12/20 02:20 PM
Those bangles are to die for! I love those shoes. Does aoynne think that the "fashion law" is really true and you can't wear white after labor day? I live in Northeastern US and always want to break the rules! http://ctdxvbff.com [url=http://uznsunxjes.com]uznsunxjes[/url] [link=http://ywixnjxg.com]ywixnjxg[/link]
Ingrese su Comentario
Comentario
Para poder votar debe estar registrado en DotNetcr.com
Solo queda registrado el primer voto enviado
Voto


Últimos Recursos
ricardo leppe t
pedrojavier
CALIN
willipinru
richard
ragomez
PER 238
MEX 236
CRI 188
COL 118
ESP 105
ARG 88