Mysql
 SQL >> Database >  >> RDS >> Mysql

Sommare i valori da Datagridview1 e salvarli in Datagridview2 con Linq e MySQL

Controlla la colonna Posted mentre scorri le righe, per verificare se una riga è già stata inserita o meno:

For Each xRows In MasterForm.oTransferRows.Where(Function(x) x.Cells("Posted").Value.ToString() = "No") 

Poi usa la seguente pseudologica per scrivere il tuo codice:

 'codice per selezionare i dati - select name from testing where name = 'Product1' 'if(dr.Read()) 'update goes here 'Else ' insert goes here 'End if