- <%@ Page Language="VB" %>
- sub ouonaffichedatatable(...)
- 'ndc est à remplacer par le nombre de colonnes-1
- dim a(ndc),numligne,i,num as integer
- dim rapport as datatable=new datatable
- 'à mettre juste avant l'affichage:
- numligne=rapports.rows.count
- if numligne>1 then
- for i=0 to numligne-1
- randomize
- num=int(rnd*(numligne-i))+i
- a(0)=rapport.rows(num).item("colonne1")
- '...une ligne par colonne...
- a(ndc)=rapport.rows(num).item("dernière colonne")
- rapport.rows(num).item("colonne1")=rapport.rows(i).item("colonne1")
- '...une ligne par colonne...
- rapport.rows(num).item("dernière colonne")rapport.rows(i)("dernière colonne")
- rapport.rows(i).item("colonne1")=a(0)
- '...une ligne par colonne...
- rapport.rows(i).item("dernière colonne")=a(ndc)
- next
- end if
- 'maintenant on affiche
- ledatagrid.datasource=rapport
- ledatagrid.databind
- end sub
<%@ Page Language="VB" %>
sub ouonaffichedatatable(...)
'ndc est à remplacer par le nombre de colonnes-1
dim a(ndc),numligne,i,num as integer
dim rapport as datatable=new datatable
'à mettre juste avant l'affichage:
numligne=rapports.rows.count
if numligne>1 then
for i=0 to numligne-1
randomize
num=int(rnd*(numligne-i))+i
a(0)=rapport.rows(num).item("colonne1")
'...une ligne par colonne...
a(ndc)=rapport.rows(num).item("dernière colonne")
rapport.rows(num).item("colonne1")=rapport.rows(i).item("colonne1")
'...une ligne par colonne...
rapport.rows(num).item("dernière colonne")rapport.rows(i)("dernière colonne")
rapport.rows(i).item("colonne1")=a(0)
'...une ligne par colonne...
rapport.rows(i).item("dernière colonne")=a(ndc)
next
end if
'maintenant on affiche
ledatagrid.datasource=rapport
ledatagrid.databind
end sub