
10/02/2010, 13:19
|
 | | | Fecha de Ingreso: octubre-2005 Ubicación: ^^CaMiNiTo Al CoSTaDo DeL
Mensajes: 850
Antigüedad: 19 años, 4 meses Puntos: 4 | |
error: referencia a objeto no establecida? hola, bueno aqui sigo intentando aprender esto de vb.net. tengo el siguiente problema
este codigo imprime el contenido un datagridvew, funcionaba todo ok, pero cuando cambio el 0 del rows por la variable i para que recorra todas las filas me da el error referencia a objeto no establecida. El siguiente codigo NO da error pero obviamente no recorre las filas
Código:
Dim i As Decimal
Dim h
i = 0
While i < detalle.RowCount
h = (i * 10) + 280
e.Graphics.DrawString(detalle.Rows(0).Cells(0).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 60, h)
e.Graphics.DrawString(detalle.Rows(0).Cells(1).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 160, h)
e.Graphics.DrawString(detalle.Rows(0).Cells(2).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 600, h)
e.Graphics.DrawString(detalle.Rows(0).Cells(3).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 700, h)
i = i + 1
End While
y el siguiente da error
Código:
Dim i As Decimal
Dim h
i = 0
While i < detalle.RowCount
h = (i * 10) + 280
e.Graphics.DrawString(detalle.Rows(i).Cells(0).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 60, h)
e.Graphics.DrawString(detalle.Rows(i).Cells(1).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 160, h)
e.Graphics.DrawString(detalle.Rows(i).Cells(2).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 600, h)
e.Graphics.DrawString(detalle.Rows(i).Cells(3).Value.ToString(), New Font("Verdana", 8), Brushes.Black, 700, h)
i = i + 1
End While
no entiendo porque, si i=0 no seria lo mismo??, saludos y gracias!!!!!!!!
__________________ hola . . .
Última edición por JAK^; 10/02/2010 a las 13:38
Razón: me olvide de saludar jejeje
|