
21/04/2005, 15:52
|
 | | | Fecha de Ingreso: abril-2005
Mensajes: 17
Antigüedad: 19 años, 10 meses Puntos: 0 | |
Saludos foro!!!
Muchas gracias Jose_minglein2 por tu respuestas.
Private Sub btnAgregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAgregar.Click
Dim temp As DataTable
temp.Columns.Add(New DataColumn(1))
temp.Columns.Add(New DataColumn(2))
Dim i As Integer = 0
While i < dgProductos.Items.Count
If CType(dgProductos.Controls.Item(i), CheckBox).Checked Then
Dim fila As DataRow = temp.NewRow fila(1) = dgProductos.Items(i).Cells(1).Text Ahora me marca error en esta linea. Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
fila(2) = dgProductos.Items(i).Cells(2).Text
temp.Rows.Add(fila)
End If
i += 1
End While
dgCompra.DataSource = temp
dgCompra.DataBind()
end sub
ojala lo puedas checar, te agradesco mucho la atencion y la ayuda que estes muy bien, saludos. |