Visual Basic - Funciones de WS Y DataGrid View

Life is soft - evento anual de software empresarial
 
Vista:

Funciones de WS Y DataGrid View

Publicado por Gustavo (5 intervenciones) el 16/09/2009 03:22:30
Tengo 2 pantallas en la primer pantalla tengo el DGV1 con un boton y este es mi codigo:

Dim Ws1 As New Service1.Service1
Dim R1 As New DataSet

R1 = Ws1.F2_DamePedidosNuevos()
DataGridView1.DataSource = R1.Tables(0)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

IdPedido = DataGridView1.Item(0, DataGridView1.CurrentRow.Index).Value
Fecha = DataGridView1.Item(1, DataGridView1.CurrentRow.Index).Value
NombreUsuario = DataGridView1.Item(2, DataGridView1.CurrentRow.Index).Value
Clasificacion = DataGridView1.Item(3, DataGridView1.CurrentRow.Index).Value

Dim SOL As New Solicitudes
SOL.Show()

End Sub

End Class

EN LA SEGUNDA PANTALLA TENGO EL SIGUIENTE CODIGO :

Private Sub Solicitudes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim Ws2 As New Service1.Service1
Dim R2 As DataSet
R2 = Ws2.F3_Dame_Solicitudes(IdPedido)
'DataGridView1.DataSource = R2.Tables(0) ESTE PARAMETRO NO ME LO ACEPTA

Label3.Text = IdPedido
Label5.Text = Fecha
Label7.Text = NombreUsuario
Label9.Text = Clasificacion

End Sub

MI DUDA ES LA COMO PUEDO INGRESAR LOS DATOS DE LA FUNCION EN MI SEGUNDA PANTALLA Y LLEGAR EL GRID DE LA SEGUNDA PANTALLA GRACIAS.

DATOS DE LA FUNCION:

<WebMethod()> Public Function F9_Dame_Listado_de_solicitudes_por_cotizar() As DataSet
Dim c As New System.Data.OleDb.OleDbConnection
Dim comando As New System.Data.oledb.OleDbCommand
Dim da As New System.Data.OleDb.OleDbDataAdapter
Dim ds As New System.Data.DataSet

c.ConnectionString = "provider = microsoft.jet.oledb.4.0;data source = " & ruta
comando.Connection = c
comando.CommandType = CommandType.Text
comando.CommandText = " SELECT Solicitudes.IdSolicitud, Marcas.Descripcion_Marca, Solicitudes.ModeloCompra, Solicitudes.DescripcionCompra FROM Marcas INNER JOIN Solicitudes ON Marcas.IdMarca = Solicitudes.MarcaCompra Where Solicitudes.StatusSolicitud = 1"
da.SelectCommand = comando
Try
c.Open()
da.Fill(ds)
c.Close()
Return ds
Catch ex As Exception
End Try
End Function
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Funciones de WS Y DataGrid View

Publicado por jaime guerrero (361 intervenciones) el 16/09/2009 19:47:42
como te dije en el otro post. esto es punto .net. pregunta en el foro correspondiente. este foro es de visual basic 6, es decir, visual basic clasico
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar