Hola
proteus8 puedes hacer algo como esto :
Código vb.net:
Ver originalPublic Sub metodo()
'creas las variables segun la cantidad de campos
'que tenga tu consulta
Dim campo1, campo2, campo3, campo4, campo5 As String
For f As Integer = 0 To DataGrid1.Rows.Count - 1 'X filas
For c As Integer = 0 To DataGrid1.Columns.Count - 1 'Asumamos 5 campos
If c = 0 Then
campo1 = DataGrid1.Rows(f).Cells(c).Value
ElseIf c = 1 Then
campo2 = DataGrid1.Rows(f).Cells(c).Value
ElseIf c = 2 Then
campo3 = DataGrid1.Rows(f).Cells(c).Value
ElseIf c = 3 Then
campo4 = DataGrid1.Rows(f).Cells(c).Value
Else
campo5 = DataGrid1.Rows(f).Cells(c).Value
End If
Next
Dim mySql As String
cnnl = New SQLiteConnection("Data Source=\BACKUP\BD\CLAS_MOBILE.db;Version=3;")
cnnl.Open()
mySql = "INSERT INTO TUTABLA VALUES('" + campo1 + "','" + campo2 + "','" + campo3 + "','" + campo4 + "','" + campo5 + "')"
insertarConsulta(mySql)
Next
End Sub
sub insertarConsulta(ByVal mySql As String)
Try
Ada = New SQLiteDataAdapter(mySql, cnnl)
'...TU CODE
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
End Try
End Sub
Espero te sea de utilidad. Saludos!