Foros del Web » Programación para mayores de 30 ;) » .NET »

Actualizar DataTable luego de borrar registro

Estas en el tema de Actualizar DataTable luego de borrar registro en el foro de .NET en Foros del Web. Hola, Tengo el siguiente codigo para borrar un registro: Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click ' If there is ...
  #1 (permalink)  
Antiguo 25/02/2011, 15:56
 
Fecha de Ingreso: febrero-2011
Mensajes: 1
Antigüedad: 13 años, 2 meses
Puntos: 0
Pregunta Actualizar DataTable luego de borrar registro

Hola,

Tengo el siguiente codigo para borrar un registro:

Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
' If there is data, delete the current row.
If m_DataTable.Rows.Count <> 0 Then
m_DataTable.Rows(m_rowPosition).Delete()
m_DA.Update(m_DataTable)
m_rowPosition = 0
Me.ShowCurrentRecord()
End If
End Sub

Pero cuando el programa pasa por la liniea " m_DA.Update(m_DataTable)", me da el siguiente error:

Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information.

Que estoy haciendo mal?

Agradeseria cualquier sugerencia.

Etiquetas: data, table
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:34.