Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/02/2007, 16:50
camilodeveloper
 
Fecha de Ingreso: junio-2006
Mensajes: 61
Antigüedad: 17 años, 10 meses
Puntos: 2
Problemas al guardar en la Bd

Saludos a todos,

Bueno el problema que tengo es que al revisar mi base de datos en access desues de agregar un registro veo que no hay nada, el codigo que tengo es el siguiente. no se si es que lo estoy haciendo mal.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim conexion As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\SERVIDOR\Mis documentos\DataBase.mdb")
conexion.Open()
Dim sql = "Select *from Empleados"
Dim Ds As New DataSet
Dim Adapter As New OleDbDataAdapter(sql, conexion)
Dim Command As New OleDbCommandBuilder(Adapter)
Adapter.Fill(Ds)
Ds.Tables(0).NewRow.Item("Nombres") = TxtNombre.Text
Ds.Tables(0).NewRow.Item("Apellidos") = TxtApellidos.Text
Ds.Tables(0).NewRow.Item("Cedula") = TxtCedula.Text
Ds.Tables(0).NewRow.Item("Telefono") = TxtTelefono.Text
Ds.Tables(0).NewRow.Item("Direccion") = TxtDireccion.Text
Ds.Tables(0).NewRow.Item("Cargo") = TxtCargo.Text
Ds.Tables(0).NewRow.Item("Email") = TxtEmail.Text
Ds.Tables(0).NewRow.Item("Celular") = TxtCelular.Text
Ds.Tables(0).NewRow.Item("Libreta_No") = TxtLibreta.Text
Adapter.Update(Ds)
conexion.Close()
Catch ErrorException As Exception
MsgBox(ErrorException.Message, MsgBoxStyle.Exclamation, "Error en tiempo de ejecucion")
End Try
Clear()
End Sub

Agradesco de antemano cualquier ayuda.