mmm ho risolto così...
Però a occhio non mi sembra elegante come cosa!
codice:int x = 1; string Gruppo1 = ""; string Gruppo2 = ""; string Gruppo3 = ""; string Gruppo4 = ""; while (matchResults.Success) { if (matchResults.Value.Length > 0) { //Response.Write("value: " + matchResults.Value + " " + x + " "); if (x == 1) Gruppo1 = matchResults.Value.ToString(); if (x == 2) Gruppo2 = matchResults.Value.ToString(); if (x == 3) Gruppo3 = matchResults.Value.ToString(); if (x == 4) Gruppo4 = matchResults.Value.ToString(); x = x + 1; if (x >= 5) { x = 1; DataRow r = dt.NewRow(); r["Cod"] = Gruppo1; r["Articolo"] = Gruppo2; r["Prezzo"] = Gruppo3; r["Q.ta"] = Gruppo4; dt.Rows.Add(r); } } matchResults = matchResults.NextMatch(); }

Rispondi quotando