Esta es la funcion que ingresa no se si estara bien pero me reporta un error
al ejecutar el
InsertCommand.ExecuteNoQuery()
perdon por constantemente recurrir a ustedes.. :(
Private Function insertar(ByVal canti As Integer, ByVal fecha As Date, ByVal
n_gen As String, ByVal n_com As String, ByVal dos As String, ByVal n_uni As
String, ByVal m_dos As String, ByVal n_prove As String)
Dim comando As New SqlCommand("insert into stock
values(@c_ingreso,@c_producto,@c_salida,@c_proveedor,@f_vence)", conexion)
Dim ada As New SqlDataAdapter()
ada.InsertCommand = comando
conta = 0
conexion.Open()
ada.InsertCommand.Parameters.Add(New SqlParameter("@c_ingreso",
SqlDbType.Int))
ada.InsertCommand.Parameters.Add(New SqlParameter("@c_producto",
SqlDbType.Int))
ada.InsertCommand.Parameters.Add(New SqlParameter("@c_salida",
SqlDbType.Int))
ada.InsertCommand.Parameters.Add(New SqlParameter("@c_proveedor",
SqlDbType.Int))
ada.InsertCommand.Parameters.Add(New SqlParameter("@f_vence",
SqlDbType.DateTime))
While conta < canti
ada.InsertCommand.Parameters("@c_ingreso").Value = get_c_inf()
ada.InsertCommand.Parameters("@c_producto").Value = get_c_prod(n_gen, n_com,
dos, n_uni, m_dos)
ada.InsertCommand.Parameters("@c_salida").Value = ""
ada.InsertCommand.Parameters("@c_proveedor").Value = get_c_prove(n_uni)
ada.InsertCommand.Parameters("@f_vence").Value = fecha
res = ada.InsertCommand.ExecuteNonQuery()
conta = conta + 1
End While
conexion.Close()
End Function
Leer las respuestas