
11/02/2009, 15:41
|
| | Fecha de Ingreso: febrero-2009
Mensajes: 4
Antigüedad: 16 años Puntos: 0 | |
Respuesta: No ejecuta el update en la base de datos Access ESTO CONTIENE LA CLASE DE AccesoDatosSocio:
Imports System.Data.OleDb
Imports Clases
Public Class AccesoDatosSocio
Public Function RegistroSocios() As DataSet
Try
Dim conexionAux As OleDbConnection = ConexionPrincipal.InstanciaConexion()
conexionAux.Open()
Dim comando As New OleDbCommand("Select * From Socios", conexionAux)
Dim adaptador As New OleDbDataAdapter(comando)
Dim ds As New DataSet
adaptador.Fill(ds)
conexionAux.Close()
Return ds
Catch ex As Exception
Throw ex
End Try
End Function
Public Sub GuardarSocio(ByVal _Socio As Socio)
Try
Dim conexionAux2 As OleDbConnection = ConexionPrincipal.InstanciaConexion()
conexionAux2.Open()
Dim comando2 As New OleDbCommand
comando2.Connection = conexionAux2
comando2.CommandType = CommandType.StoredProcedure
comando2.CommandText = "InsertarSocio"
comando2.Parameters.Add("@NombreCompleto", _Socio.NombreCompleto)
comando2.Parameters.Add("@Ci", _Socio.Ci)
comando2.Parameters.Add("@Telefono", _Socio.Telefono)
comando2.Parameters.Add("@Celular", _Socio.Celular)
comando2.Parameters.Add("@Domicilio", _Socio.Domicilio)
comando2.Parameters.Add("@FechaIngreso", _Socio.FechaIngreso)
comando2.Parameters.Add("@EstadSocio", _Socio.EstadoSocio)
comando2.ExecuteNonQuery()
conexionAux2.Close()
Catch ex As Exception
Throw ex
End Try
End Sub
Public Sub ActualizarSocio(ByVal _Socio As Socio)
Try
Dim conexionAux3 As OleDbConnection = ConexionPrincipal.InstanciaConexion()
conexionAux3.Open()
Dim comando3 As New OleDbCommand
comando3.Connection = conexionAux3
comando3.CommandType = CommandType.StoredProcedure
comando3.CommandText = "ActualizarSocio"
comando3.Parameters.Add("@NombreCompleto", _Socio.NombreCompleto)
comando3.Parameters.Add("@Ci", _Socio.Ci)
comando3.Parameters.Add("@Telefono", _Socio.Telefono)
comando3.Parameters.Add("@Celular", _Socio.Celular)
comando3.Parameters.Add("@Domicilio", _Socio.Domicilio)
comando3.Parameters.Add("@FechaIngreso", _Socio.FechaIngreso)
comando3.Parameters.Add("@EstadSocio", _Socio.EstadoSocio)
comando3.ExecuteNonQuery()
conexionAux3.Close()
Catch ex As Exception
Throw ex
End Try
End Sub
End Class |