Ver Mensaje Individual
  #4 (permalink)  
Antiguo 20/06/2005, 05:47
Avatar de Jose_minglein2
Jose_minglein2
 
Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 20 años, 4 meses
Puntos: 8
supongamos que tienes la consulta hecha sobre un datareader llamado dr, pues ahora haríamos

dim tabla as datatable = new datatable
tabla.columns.add("Nombre")
tabla.columns.add("Datos")

dim fila as datarow
while dr.read
fila = tabla.newrow()
fila("Nombre") = "nombreusu"
fila("datos") = dr("nombreusu")
tabla.rows.add(fila)

fila = tabla.newrow()
fila("Nombre") = "apellidousu"
fila("datos") = dr("apellidousu")
tabla.rows.add(fila)
.....
end while

datagrid1.datasource = tabla