Verifica Datarow

martedì 03 aprile 2012 - 15.25
Tag Elenco Tags  VB.NET  |  .NET 4.0  |  Windows 7  |  Visual Studio 2010  |  SQL Server 2008 R2  |  Internet explorer 8.0  |  Chrome

mrtritolo87 Profilo | Newbie

Ciao ragazzi, domanda semplice, premetto che sono nuovo in vb.net

Devo verificare l'esitenza di una riga in datatable per eventualmente aggiungerla

Vi posto il codice

For CONTATORE = 0 To tblLisa.Rows.Count If CONTATORE = 350 Then MsgBox("ciao") End If ' If tbllisa.rows(posizione contatore) esite Then If tblLab.Rows(CONTATORE).Item(0) = tblLisa.Rows(CONTATORE).Item(0) Then Else tblLab.Rows(CONTATORE).Item(0) = tblLisa.Rows(CONTATORE).Item(0) tblLab.Rows(CONTATORE).Item(1) = tblLisa.Rows(CONTATORE).Item(1) End If Else tblLab.Rows.Add(tblLisa.Rows(CONTATORE).Item(0), tblLisa.Rows(CONTATORE).Item(1)) End If ProgressBar1.Value = ProgressBar1.Value + 1 Next

massimo.missaglia Profilo | Newbie

Ciao,
prova a guardare qui:

http://support.microsoft.com/kb/308909

utilizza il metodo "ImportRow" inoltre, se ti può essere utile, c'è anche il "Contains" sulla Row.
Massimo Missaglia
-------------------------------
www.MassimoMissaglia.com
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5