Visual Basic.NET - Guardar dato desde inputbox

 
Vista:
Imágen de perfil de Rayner

Guardar dato desde inputbox

Publicado por Rayner (13 intervenciones) el 20/12/2017 18:46:42
La ayuda que necesito es como guardar un dato a mi base de dato en sql server, desde un inputbox, hago esta sentencia y no me funciona
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Dim cmd As New SqlCommand
Dim Cantidad As Integer
Try
    Abrir()
    cmd = New SqlCommand("AumentarCant", conex)
    cmd.CommandType = 4
    With cmd.Parameters
        .AddWithValue("@IdProducto", TxtID.Text)
        .AddWithValue("@Cantidad", InputBox("Ingresar Nuevos Productos", "Stock", Cantidad))
    End With
    Mostrar()
 
Catch ex As Exception
    MsgBox(ex.Message)
End Try

No se cual otra sentencia utilizar, he intentado con Add, y tampoco funciona.. que hago mal?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder