Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/10/2010, 10:30
Avatar de thegodinez
thegodinez
 
Fecha de Ingreso: octubre-2010
Ubicación: Culiacán, Sinaloa
Mensajes: 54
Antigüedad: 13 años, 7 meses
Puntos: 5
Respuesta: Datos de TextBox Visual Basic 2010 a Access

Cita:
Iniciado por gedarufi Ver Mensaje
He estado revisando tu código y no veo nada sobre el procedimiento almacenado, lo que te recomiendo es que crees un insert, con eso se solucionaran tus problemas.

Saludos
Cita:
Iniciado por gedarufi Ver Mensaje
Seria algo por el estilo

Código VB:
Ver original
  1. Dim Comando As New OleDbCommand
  2. With Comando
  3. Cone.Open()
  4. .CommandText = "Insert into Alumnos values (@Credencial, @Nombre, @Direccion, @Telefono)"
  5. .Connection = Cone
  6. .Parameters.Add("@Credencial", OleDbType.Char, 10).Value = Me.TextBox3.Text
  7. .Parameters.Add("@Nombre", OleDbType.VarChar, 50).Value = Me.TextBox1.Text
  8. .Parameters.Add("@Direccion", OleDbType.VarChar, 50).Value = Me.TextBox2.Text
  9. .Parameters.Add("@Telefono", OleDbType.VarChar, 50).Value = Me.TextBox4.Text
  10. End With
  11. Dim Bien As Integer = Comando.ExecuteNonQuery
  12. If Bien = 0 Then
  13. Throw New Exception("Falló la operacion de inserción")
  14. End If
  15. Comando.Dispose()
  16. Cone.Close()
  17. Cone.Dispose()
  18. MessageBox.Show("Datos Ingresados con éxito", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information)
  19. Catch ex As Exception
  20. MessageBox.Show(ex.Message, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error)
  21. End Try
  22. Else
  23. MessageBox.Show("Operacion cancelada por el usuario", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  24. End If
  25. End Sub
Estoy aplicando el nuevo codigo y te agregue al msn.