Error ORA-12571 TNS:packet writer failure


              Hi All.

              I use oracle provider to deal with oracle table that have the following   description :
       Name                                                  Null?              Type
              -----------------------------------------------------               -------- -------------
     EMPNO                                                 NOT NULL  NUMBER(4)
     ENAME                                                          VARCHAR2(10)
     JOB                                                            VARCHAR2(9)
       CITY                                                           VARCHAR2(10)
       SAL                                                             NUMBER(7,2)
             I used the following code to update a record on that table:

             string ConncetionString = "Data Source = Oracle8i;" +
                   "user id=scott;password=tiger";

                OracleConnection con = new OracleConnection(ConncetionString);

                OracleCommand cmd = new OracleCommand();
                cmd.CommandText = @"update myemployee set ename=:ename,job=:job
                                        where empno=:empno";
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.Connection = con;

                cmd.Parameters.Add(new OracleParameter(":ename", OracleType.VarChar, 10));
                cmd.Parameters[":ename"].Value = "Alaa";
                cmd.Parameters.Add(new OracleParameter(":empno", OracleType.Int32, 4));
                cmd.Parameters[":empno"].Value = 7839;
                cmd.Parameters.Add(new OracleParameter(":job", OracleType.VarChar, 9));

                cmd.Parameters[":job"].Value ="Presedent" ;

                catch (Exception exep)
                    myForm.Label1.Text += "Error " + exep.Message;
                    myForm.Label1.Text += "Status" + con.State;

    but the update fialed and give me the follwing error : Error ORA-12571 TNS:packet writer failure.

    then I reduce the size of the cmd.Parameters[":job"].Value to "Pres" and it works fine.

    can any one help me to solve this problem and let me to save the whole world without any error.

    thanks alot.

    Alaa Farah

    Wednesday, January 7, 2009 11:45 PM

All replies

  • Hi,
    I do not see which Oracle Client version you use.
    Could you make sure that you installed the latest patch for Oracle Client?


    Ryszard Gawron [MSFT]

    This posting is provided "AS IS" with no warranties, and confers no rights.”

    Tuesday, January 13, 2009 9:50 AM