Ciao ho una DataTable dalla quale devo eliminare le righe che hanno determinati campi con valore = 0, ma mi scontro con la logica del mio loop.

Codice :

codice:
        For X As Int32 = 0 To tblTot.Rows.Count - 1
                If CInt(tblTot.Rows(X).Item("LANDA")) = 0 And _
                    CInt(tblTot.Rows(X).Item("SOLD")) = 0 And _
                    CInt(tblTot.Rows(X).Item("AVAIL")) = 0 And _
                    CInt(tblTot.Rows(X).Item("TSOLD")) = 0 And _
                    CInt(tblTot.Rows(X).Item("XSOLD")) = 0 And _
                    CInt(tblTot.Rows(X).Item("SGL")) = 0 And _
                    CInt(tblTot.Rows(X).Item("TRP")) = 0 And _
                    CInt(tblTot.Rows(X).Item("INDEP")) = 0 And _
                    CInt(tblTot.Rows(X).Item("GRDEP")) = 0 And _
                    CInt(tblTot.Rows(X).Item("INOPT")) = 0 And _
                    CInt(tblTot.Rows(X).Item("GROPT")) = 0 And _
                    CInt(tblTot.Rows(X).Item("TWINS")) = 0 And _
                    CInt(tblTot.Rows(X).Item("SFEMS")) = 0 And _
                    CInt(tblTot.Rows(X).Item("SMALS")) = 0 Then
                    tblTot.Rows(X).Delete()
                End If
        Next
Quando arriva a 7000 circa, mi dice che il record corrispondente non esiste, questo perchè il COunt delle Rows cambia ogni volta che elimino una riga ...

Avete qualche suggerimento?