El primer registro

19/07/2004 - 16:33 por Carmelo Gonzalez | Informe spam
Hola Amigos!!!
Les escribo porque se me esta presentando un pequeño detalle al momento de
grabar el primer registro dentro de una tabla:

me dice el siguiente mensaje:

NO HAY NINGUNA FILA EN LA POSICION 0


y lo hagoi de la siguiente manera:


Try

Dim drAgregar As DataRow = Banco1.Tables("Bancos").NewRow

drAgregar("Codigo") = "00" & Trim(Str(nContador))

drAgregar("Nombre") = txtBanco.Text

drAgregar("DiasMB") = nMB

drAgregar("DiasOB") = nOB

!!!AQUI ME DA EL ERROR NO HAY NINGUNA FILA EN LA POSICION 0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!

Banco1.Tables("Bancos").Rows.Add(drAgregar) AQUI ME DA EL ERROR NO HAY
NINGUNA FILA EN LA POSICION 0

!!AQUI ME DA EL ERROR NO HAY NINGUNA FILA EN LA POSICION
0!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!

ODBBanco.Update(Banco1)

Banco1.AcceptChanges()

'Vuelve a Cargar los datos

Banco1.Clear()

ODBBanco.Fill(Banco1)

MostrarDatos(Me.BindingContext(Banco1, "Bancos").Position)



GRACIAS POR SU AYUDA



CARMELO GONZALEZ
 

Leer las respuestas

#1 Carmelo Gonzalez
19/07/2004 - 16:56 | Informe spam
Banco1.Tables("Bancos").Rows.Add(drAgregar)

AQUI ME DA EL ERROR NO HAY NINGUNA FILA EN LA POSICION 0

Este error me da en un ComboBox que tengo asociado al DataSet y capturo hay
el mensaje
Try

MostrarDatos(cbCodigo.SelectedIndex)

Me.BindingContext(Banco1, "Bancos").Position = cbCodigo.SelectedIndex

Catch eMover As SystemException

MessageBox.Show(eMover.Message, cMensaje, MessageBoxButtons.OK,
MessageBoxIcon.Information)

End Try

Preguntas similares