Actualizar DataAdapter, DataSet y BaseDatos
Publicado por Adolfo (55 intervenciones) el 29/04/2011 03:04:56
Luego de modificar los campos en la pantalla, al precional el boton para actualizar el registro el programa pasa por todas las lineas y muestra el mensaje "El registro ha sido actualizado satisfactoriamente."
Sin embargo no acutaliza el registro en la Tabla de la base de datos, y no he podido determine que es lo que estoy hacindo mal?
Agradeceria cualquier ayuda o sugerencia al respecto.
With ds.Tables("TBRolPantallas")
.Rows(m_rowPosition)("Rol") = CBRolEmpleado.Text
If CKBAgregar.Checked = False Then
.Rows(m_rowPosition)("Principal") = False
Else
.Rows(m_rowPosition)("Principal") = True
End If
If CKBFacturacion.Checked = False Then
.Rows(m_rowPosition)("Facturacion") = False
Else
.Rows(m_rowPosition)("Facturacion") = True
End If
If CKBInventario.Checked = False Then
.Rows(m_rowPosition)("Inventario") = False
Else
.Rows(m_rowPosition)("Inventario") = True
End If
If CKBIngresoProd.Checked = False Then
.Rows(m_rowPosition)("IngresoProd") = False
Else
.Rows(m_rowPosition)("IngresoProd") = True
End If
End With
ds.AcceptChanges()
da.Update(ds, "TBRolPantallas")
MessageBox.Show("El registro ha sido actualizado satisfactoriamente.", "Informacion.", MessageBoxButtons.OK, MessageBoxIcon.Information)
Sin embargo no acutaliza el registro en la Tabla de la base de datos, y no he podido determine que es lo que estoy hacindo mal?
Agradeceria cualquier ayuda o sugerencia al respecto.
With ds.Tables("TBRolPantallas")
.Rows(m_rowPosition)("Rol") = CBRolEmpleado.Text
If CKBAgregar.Checked = False Then
.Rows(m_rowPosition)("Principal") = False
Else
.Rows(m_rowPosition)("Principal") = True
End If
If CKBFacturacion.Checked = False Then
.Rows(m_rowPosition)("Facturacion") = False
Else
.Rows(m_rowPosition)("Facturacion") = True
End If
If CKBInventario.Checked = False Then
.Rows(m_rowPosition)("Inventario") = False
Else
.Rows(m_rowPosition)("Inventario") = True
End If
If CKBIngresoProd.Checked = False Then
.Rows(m_rowPosition)("IngresoProd") = False
Else
.Rows(m_rowPosition)("IngresoProd") = True
End If
End With
ds.AcceptChanges()
da.Update(ds, "TBRolPantallas")
MessageBox.Show("El registro ha sido actualizado satisfactoriamente.", "Informacion.", MessageBoxButtons.OK, MessageBoxIcon.Information)
Valora esta pregunta


0