Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/04/2011, 08:20
Avatar de Carlojas
Carlojas
 
Fecha de Ingreso: junio-2007
Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 16 años, 10 meses
Puntos: 49
Respuesta: Insertar en SQL un DataGridView entero?

Que tal Frehley lo puedes hacer de esta forma:
Código vb:
Ver original
  1. For Each Row As DataGridViewRow In TUDATAGRIDVIEW.Rows
  2. If Row.Cells(1).Value <> String.Empty Then
  3.    If Row.Cells(7).Value.ToString.Contains("A") Then
  4.       consulta = "INSERT INTO TUTABLA (columna1,columna2,columna3,columna4) VALUES ('" + Row.Cells(1).Value + "','" + Row.Cells(2).Value + "','" + Row.Cells(3).Value + "','" + Row.Cells(4).Value + "') "
  5. 'Ejecutas tu consulta
  6.    End If
  7. End If
  8. Next Row
Creo que la conexión a tu BD la sabes hacer, y de igual forma ejecutar consultas.


Saludos.
__________________
"SELECT * FROM Mujeres WHERE situacion NOT IN ('CASADAS','CON HIJOS','ATORMENTADAS','CUASI-ENNOVIADAS') AND personalidad <> 'INTENSA'"