Error Oracle y .Net
Publicado por oscar (1 intervención) el 20/02/2006 14:13:01
Tengo un problema con oracle y visual basic .net: Trato de insertar en una tabla que tiene 2 campos: uno tipo integer y otro long raw, y tengo el siguiente codigo:
Public Function AddTemplate(ByRef template As TTemplate, ByRef x As Util, ByVal nCodigo As Integer) As Long
Dim da As New OracleDataAdapter("select * from enroll order by ID", connection)
Dim xx As OracleClient.OracleDataAdapter
da.InsertCommand = New OracleCommand("INSERT INTO enroll (ID,template) Values(?,?)", connection)
da.InsertCommand.CommandType = CommandType.Text
da.InsertCommand.Parameters.Add("@ID", OracleType.Int16, 16, "ID")
da.InsertCommand.Parameters.Add("@template", OracleType.LongRaw, template.Size, "template")
Dim enroll As DataSet = New DataSet
da.Fill(enroll, "enroll")
Dim newRow As DataRow = enroll.Tables("enroll").NewRow()
newRow("template") = template.tpt
newRow("ID") = nCodigoEnroll
enroll.Tables("enroll").Rows.Add(newRow)
Try
da.Update(enroll, "enroll")
connection.Close()
da.InsertCommand = New OracleCommand("commit")
Return newRow("ID")
Catch exc As Exception
Console.Write(exc.ToString())
Debug.Write(exc.ToString())
x.FinalizeGrFinger()
End Try
End Function
///////////////////
Al llegar a la primera instrucción dentro del boque try me genera el error ORA-01036. Alguien me puede decir porque? Y revisé los nombres de lols campos en la instruccion insert y están bien, no se que podría ser. Gracias
Public Function AddTemplate(ByRef template As TTemplate, ByRef x As Util, ByVal nCodigo As Integer) As Long
Dim da As New OracleDataAdapter("select * from enroll order by ID", connection)
Dim xx As OracleClient.OracleDataAdapter
da.InsertCommand = New OracleCommand("INSERT INTO enroll (ID,template) Values(?,?)", connection)
da.InsertCommand.CommandType = CommandType.Text
da.InsertCommand.Parameters.Add("@ID", OracleType.Int16, 16, "ID")
da.InsertCommand.Parameters.Add("@template", OracleType.LongRaw, template.Size, "template")
Dim enroll As DataSet = New DataSet
da.Fill(enroll, "enroll")
Dim newRow As DataRow = enroll.Tables("enroll").NewRow()
newRow("template") = template.tpt
newRow("ID") = nCodigoEnroll
enroll.Tables("enroll").Rows.Add(newRow)
Try
da.Update(enroll, "enroll")
connection.Close()
da.InsertCommand = New OracleCommand("commit")
Return newRow("ID")
Catch exc As Exception
Console.Write(exc.ToString())
Debug.Write(exc.ToString())
x.FinalizeGrFinger()
End Try
End Function
///////////////////
Al llegar a la primera instrucción dentro del boque try me genera el error ORA-01036. Alguien me puede decir porque? Y revisé los nombres de lols campos en la instruccion insert y están bien, no se que podría ser. Gracias
Valora esta pregunta


0