Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/07/2005, 09:41
fredy666
 
Fecha de Ingreso: enero-2005
Ubicación: Benifaió (Valencia)
Mensajes: 319
Antigüedad: 20 años, 1 mes
Puntos: 0
A mi me sale el siguiente error:

Código:
Excepción no controlada del tipo 'System.Data.SqlClient.SqlException' en system.data.dll
El codigo que he hecho en vb.net es:
Código:
        Dim ocmd As New SqlCommand
        Dim sqlcadena As New String("Insert into tbl2BaseSoftware(IdXNSoft, fldTTitulo, fldTVersion, idNMaker, idNCategoria) values(@clave, @nombre, @version, @fabricantes, @categoria)")
        ocmd.Parameters.Add(New SqlParameter("@clave", SqlDbType.Int, 4)).Value = txtCodigo.Text
        ocmd.Parameters.Add(New SqlParameter("@nombre", SqlDbType.VarChar, 50)).Value = txtNombre.Text
        ocmd.Parameters.Add(New SqlParameter("@version", SqlDbType.VarChar, 50)).Value = txtVersion.Text
        ocmd.Parameters.Add(New SqlParameter("@fabricante", SqlDbType.Int, 4)).Value = fabricante
        ocmd.Parameters.Add(New SqlParameter("@categoria", SqlDbType.Int, 4)).Value = categoria

        MsgBox("Datos a insertar: " & txtCodigo.Text & " " & txtNombre.Text & " " & txtVersion.Text & " " & fabricante & " " & categoria)

        If añadir = 1 Then 'Podemos continuar para añadir el fabricante.
            'conection.Open()
            ocmd.CommandText = sqlcadena
            ocmd.Connection = conection

            ocmd.ExecuteNonQuery()
¿Donde esta el error?? En otros formularios si que funciona, pero en este que tiene datos relacionados de otras tablas no :(

Gracias