Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/04/2011, 09:03
Ka0stj
 
Fecha de Ingreso: febrero-2010
Ubicación: México
Mensajes: 738
Antigüedad: 14 años, 2 meses
Puntos: 37
Respuesta: mostrar consulta en un datagridview y actualizar tabla con los datos modif

Hola laura_milefv

Que has logrado hasta ahorita?, Ya lograste llenar tu DataGridView?, si no puedes utilizar algo similar a lo siguiente:

Código vb:
Ver original
  1. Public Sub CargarDataGridView(ByVal ElDataGridView, ByVal LaConsulta)
  2.  
  3.         _ObjConn = New SqlConnection(CadenaConexion)
  4.  
  5.         Dim ElDataTable As DataTable = New DataTable
  6.         Dim ElReader As SqlDataReader
  7.         Dim ElComando As SqlCommand
  8.  
  9.         Try
  10.             _ObjConn.Open()
  11.  
  12.             ElComando = New SqlCommand(LaConsulta, _ObjConn)
  13.             ElReader = ElComando.ExecuteReader()
  14.  
  15.             ElDataTable.Load(ElReader)
  16.  
  17.             ElDataGridView.DataSource = ElDataTable
  18.  
  19.             _ObjConn.Close()
  20.  
  21.         Catch ex As Exception
  22.             MsgBox("Error al cargar el DataGridView.", MsgBoxStyle.Critical, "Error")
  23.         End Try
  24.  
  25.     End Sub

Con respecto al update como lo haras?, los rows del DataGridView serán editables?, tendrás otra pantalla de edición?

Saludos!
__________________
http://ka0stj.wordpress.com/