Ver Mensaje Individual
  #9 (permalink)  
Antiguo 31/03/2004, 16:01
chcma
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 21 años, 8 meses
Puntos: 7
ASI ACABAMOS ANTES, HABER QUE VES.


**********************
*** SERVICIO WEB *****
**********************

Imports System.Web.Services
Imports System.Data.SqlClient
<WebService(Namespace := "http://tempuri.org/")> _
Public Class Service1
Inherits System.Web.Services.WebService
#CODIGO GENERADO POR EL DISEÑADOR...
Dim CN As New SqlConnection("cadena_De_Conexion")
Dim DA As SqlDataAdapter = New SqlDataAdapter("select * from talumnos", CN)
Dim DS As DataSet = New DataSet()
Dim FA As DataRow
Dim i As Int16 = 0
Dim UnArray(0) As String
<WebMethod()> Public Function Datos() As Array
Try
DA.Fill(DS, "DTalumnos")
For Each FA In DS.Tables("DTalumnos").Rows
UnArray(i) = FA("nombre")
i += 1
ReDim Preserve UnArray(i)
Next
Catch Ex As Exception
MsgBox(Ex.Message & "HOLA")
End Try
Return UnArray
End Function
End Class






**********************
*** CLIENTE WIND ***
**********************
Public Class Form1
Inherits System.Windows.Forms.Form
#Codigo Generado Por el Diseñador . . .
Dim ServicioWeb As New localhost.Service1()
Dim MiArray As Array
Private Sub Button1_Click(...)TODO EL ROLLO DEl HANDLES
Try
MiArray = ServicioWeb.Datos()
Catch EX As Exception
MsgBox(EX.Message)
End Try
End Sub
End Class
__________________
Charlie.