
no se han especificado valores para algunos de los parámetros requeridos
Publicado por Alexis (1 intervención) el 21/11/2022 02:51:41
Tengo este codigo que hace que guarde datos en la base de datos pero a la hora de darle al boton me sale un error diciendo que no se han especificado valores para algunos de los parámetros requeridos
Espero y me puedan ayudar
Private Sub btn_agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_agregar.Click
Dim NoControl As String
Dim Nombre As String
Dim ApellidoPaterno As String
Dim ApellidoMaterno As String
Dim FechaDeNacimiento As String
Dim Genero As String
Dim Curp As String
Dim Calle As String
Dim NumeroDeCasa As String
Dim Colonia As String
Dim Localidad As String
Dim Municipio As String
Dim Codigo_Postal As String
Dim Telefono As String
Dim Celular As String
Dim CorreoElectronico As String
Dim Secundaria As String
Dim GrupoSanguineo As String
Dim Alergias As String
Dim Semestre As String
Dim Grupo As String
Dim Turno As String
Dim Nombrepadreotutor As String
Dim CallePMT As String
Dim NumerodecasaPMT As String
Dim ColoniaPMT As String
Dim LocalidadPMT As String
Dim MunicipioPMT As String
Dim CodigoPostalPMT As String
Dim TelefonoPMT As String
Dim CorreoElectronicoPMT As String
Dim Parentesco As String
If chk_masculino.Checked Then
Genero = "Masculino"
txt_genero.Text = Genero
End If
If chk_femenino.Checked Then
Genero = "Femenino"
txt_genero.Text = Genero
End If
NoControl = Me.txt_numerodecontrol.Text
Nombre = " ' " & Me.txt_nombre.Text & " ' "
ApellidoPaterno = " ' " & Me.txt_apellidopaterno.Text & " ' "
ApellidoMaterno = " ' " & Me.txt_apellidomaterno.Text & " ' "
FechaDeNacimiento = Me.txt_fechadenacimiento.Text
Genero = Me.txt_genero.Text
Curp = Me.txt_curp.Text
Calle = Me.txt_calle.Text
NumeroDeCasa = Me.txt_numerodecasa.Text
Colonia = " ' " & Me.txt_colonia.Text & " ' "
Localidad = " ' " & Me.txt_localidad.Text & " ' "
Municipio = Me.txt_municipio.Text
Codigo_Postal = Me.txt_codigopostal.Text
Telefono = Me.txt_telefono.Text
Celular = Me.txt_celular.Text
CorreoElectronico = " ' " & Me.txt_correoelectronico.Text & " ' "
Secundaria = " ' " & Me.txt_egresadode.Text & " ' "
GrupoSanguineo = Me.txt_gruposanguineo.Text
Alergias = Me.txt_alergias.Text
Semestre = " ' " & Me.txt_semestre.Text & " ' "
Grupo = Me.txt_grupo.Text
Turno = Me.txt_turno.Text
Nombrepadreotutor = " ' " & Me.txt_nombrepmt.Text & " ' "
CallePMT = Me.txt_domiciliopmt.Text
NumerodecasaPMT = Me.txt_numerodecasapmt.Text
ColoniaPMT = " ' " & Me.txt_coloniapmt.Text & " ' "
LocalidadPMT = " ' " & Me.txt_localidadpmt.Text & " ' "
MunicipioPMT = Me.txt_municipiopmt.Text
CodigoPostalPMT = Me.txt_codigopostalpmt.Text()
TelefonoPMT = Me.txt_telefonopmt.Text
CorreoElectronicoPMT = " ' " & Me.txt_correoelectronicopmt.Text & " ' "
Parentesco = Me.txt_parentesco.Text
If CONN.State = ConnectionState.Closed Then
CONN.Open()
End If
Dim cmd As New OleDbCommand("INSERT INTO AlumnosMediaSuperior(Numero_de_control,Nombre,Apellido_Paterno,Apellido_Materno,Fecha_Nacimiento,Genero,Curp,Calle,Numero_De_casa,Colonia,Localidad,Municipio,Codigo_Postal,Telefono,Celular,Correo_Electronico,Secundaria,Grupo_Sanguineo,Alergias,Semestre,Grupo,Turno,Nombre_padre_o_tutor,Calle_P_M_T,No_de_casa_P_M_T,Colonia_P_M_T,Localidad_P_M_T,Municipio_P_M_T,Codigo_Postal_P_M_T,Telefono_P_M_T,Correo_Electronico_P_M_T,Parentesco)VALUES(" & NoControl & "," & Nombre & "," & ApellidoPaterno & "," & ApellidoMaterno & "," & FechaDeNacimiento & "," & Genero & "," & Curp & "," & Calle & "," & NumeroDeCasa & "," & Colonia & "," & Localidad & "," & Municipio & "," & Codigo_Postal & "," & Telefono & "," & Celular & "," & CorreoElectronico & "," & Secundaria & "," & GrupoSanguineo & "," & Alergias & "," & Semestre & "," & Grupo & "," & Turno & "," & Nombrepadreotutor & "," & CallePMT & "," & NumerodecasaPMT & "," & ColoniaPMT & "," & LocalidadPMT & "," & MunicipioPMT & "," & CodigoPostalPMT & "," & TelefonoPMT & "," & CorreoElectronicoPMT & "," & Parentesco & ")", CONN)
cmd.ExecuteNonQuery() EL ERROR SALE AQUI
If CONN.State = ConnectionState.Open Then
CONN.Close()
End If
MsgBox("Datos Insertados Correctamente", vbInformation, "Confirmar")
End Sub
Espero y me puedan ayudar
Private Sub btn_agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_agregar.Click
Dim NoControl As String
Dim Nombre As String
Dim ApellidoPaterno As String
Dim ApellidoMaterno As String
Dim FechaDeNacimiento As String
Dim Genero As String
Dim Curp As String
Dim Calle As String
Dim NumeroDeCasa As String
Dim Colonia As String
Dim Localidad As String
Dim Municipio As String
Dim Codigo_Postal As String
Dim Telefono As String
Dim Celular As String
Dim CorreoElectronico As String
Dim Secundaria As String
Dim GrupoSanguineo As String
Dim Alergias As String
Dim Semestre As String
Dim Grupo As String
Dim Turno As String
Dim Nombrepadreotutor As String
Dim CallePMT As String
Dim NumerodecasaPMT As String
Dim ColoniaPMT As String
Dim LocalidadPMT As String
Dim MunicipioPMT As String
Dim CodigoPostalPMT As String
Dim TelefonoPMT As String
Dim CorreoElectronicoPMT As String
Dim Parentesco As String
If chk_masculino.Checked Then
Genero = "Masculino"
txt_genero.Text = Genero
End If
If chk_femenino.Checked Then
Genero = "Femenino"
txt_genero.Text = Genero
End If
NoControl = Me.txt_numerodecontrol.Text
Nombre = " ' " & Me.txt_nombre.Text & " ' "
ApellidoPaterno = " ' " & Me.txt_apellidopaterno.Text & " ' "
ApellidoMaterno = " ' " & Me.txt_apellidomaterno.Text & " ' "
FechaDeNacimiento = Me.txt_fechadenacimiento.Text
Genero = Me.txt_genero.Text
Curp = Me.txt_curp.Text
Calle = Me.txt_calle.Text
NumeroDeCasa = Me.txt_numerodecasa.Text
Colonia = " ' " & Me.txt_colonia.Text & " ' "
Localidad = " ' " & Me.txt_localidad.Text & " ' "
Municipio = Me.txt_municipio.Text
Codigo_Postal = Me.txt_codigopostal.Text
Telefono = Me.txt_telefono.Text
Celular = Me.txt_celular.Text
CorreoElectronico = " ' " & Me.txt_correoelectronico.Text & " ' "
Secundaria = " ' " & Me.txt_egresadode.Text & " ' "
GrupoSanguineo = Me.txt_gruposanguineo.Text
Alergias = Me.txt_alergias.Text
Semestre = " ' " & Me.txt_semestre.Text & " ' "
Grupo = Me.txt_grupo.Text
Turno = Me.txt_turno.Text
Nombrepadreotutor = " ' " & Me.txt_nombrepmt.Text & " ' "
CallePMT = Me.txt_domiciliopmt.Text
NumerodecasaPMT = Me.txt_numerodecasapmt.Text
ColoniaPMT = " ' " & Me.txt_coloniapmt.Text & " ' "
LocalidadPMT = " ' " & Me.txt_localidadpmt.Text & " ' "
MunicipioPMT = Me.txt_municipiopmt.Text
CodigoPostalPMT = Me.txt_codigopostalpmt.Text()
TelefonoPMT = Me.txt_telefonopmt.Text
CorreoElectronicoPMT = " ' " & Me.txt_correoelectronicopmt.Text & " ' "
Parentesco = Me.txt_parentesco.Text
If CONN.State = ConnectionState.Closed Then
CONN.Open()
End If
Dim cmd As New OleDbCommand("INSERT INTO AlumnosMediaSuperior(Numero_de_control,Nombre,Apellido_Paterno,Apellido_Materno,Fecha_Nacimiento,Genero,Curp,Calle,Numero_De_casa,Colonia,Localidad,Municipio,Codigo_Postal,Telefono,Celular,Correo_Electronico,Secundaria,Grupo_Sanguineo,Alergias,Semestre,Grupo,Turno,Nombre_padre_o_tutor,Calle_P_M_T,No_de_casa_P_M_T,Colonia_P_M_T,Localidad_P_M_T,Municipio_P_M_T,Codigo_Postal_P_M_T,Telefono_P_M_T,Correo_Electronico_P_M_T,Parentesco)VALUES(" & NoControl & "," & Nombre & "," & ApellidoPaterno & "," & ApellidoMaterno & "," & FechaDeNacimiento & "," & Genero & "," & Curp & "," & Calle & "," & NumeroDeCasa & "," & Colonia & "," & Localidad & "," & Municipio & "," & Codigo_Postal & "," & Telefono & "," & Celular & "," & CorreoElectronico & "," & Secundaria & "," & GrupoSanguineo & "," & Alergias & "," & Semestre & "," & Grupo & "," & Turno & "," & Nombrepadreotutor & "," & CallePMT & "," & NumerodecasaPMT & "," & ColoniaPMT & "," & LocalidadPMT & "," & MunicipioPMT & "," & CodigoPostalPMT & "," & TelefonoPMT & "," & CorreoElectronicoPMT & "," & Parentesco & ")", CONN)
cmd.ExecuteNonQuery() EL ERROR SALE AQUI
If CONN.State = ConnectionState.Open Then
CONN.Close()
End If
MsgBox("Datos Insertados Correctamente", vbInformation, "Confirmar")
End Sub
Valora esta pregunta


0