Oracle 9.2 and vb.Net

Using Visual Sutdio .Net 2003, I've been trying to do a paramertized insert into an oracle 9.2 database.  When i use a string defined as a varchar it only inserts the first half of the string.  example  'This is a test' gets stored as 'This is'.

 Also depending on how i defined the oracle parameters and add them i get a ORA-12571: TNS:packet writer failure .


Here's the test code i've been trying:

     'Dim conn As New OracleConnection(cs)
        OracleConnection1.Open()
 

        Dim insertcmd As New OracleCommand
        insertcmd = New OracleCommand("insert into nurs_data_detail " & _
                              " ( nursing_num, comments, entry_date ) values " & _
                              " ( :nursing_id, :comments,  sysdate ) " & _
                              "   ", OracleConnection1)
 

        Dim p1 As New OracleParameter("nursing_id", OracleType.Int32)
        p1.Direction = ParameterDirection.Input  ' optional
        p1.Size = 12  ' optional
        p1.Value = nursing_id
        insertcmd.Parameters.Add(p1) ' VB.NET
 
        Dim p4 As New OracleParameter("comments", OracleType.VarChar)
        p4.Direction = ParameterDirection.Input  ' optional
        p4.Value = "This is supposed to be a long line"
        insertcmd.Parameters.Add(p4) ' VB.NET
 
 
       insertcmd.ExecuteNonQuery()

I'm thinking there's problems with the Oracle classes and maybe there's a fix for this
Thanks


Answer this question

Oracle 9.2 and vb.Net

  • Jorgen Thyme

    Hi,

    I am getting the same error.

    Wasnt DAAB suppose to work with 8.1.7

    If OracleClient works with that version, I am surprised as to why DAAB wont work..

    Do you know what made you go for the upgrade on the client

    Thanks,

    Chintu


  • RoboForm

    I solved the problem.  I was running the Oracle8.1 client.  I loaded Oracle 9.2 client and all seems to be working as advertised.

    -WW

  • Oracle 9.2 and vb.Net