Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Problem with Oracle Parameter - not getting whole value of parameter

Last post 05-19-2008 5:58 PM by Probi. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-19-2008 5:58 PM

    • Probi
    • Not Ranked
    • Joined on 04-24-2008
    • Portugal
    • New Member
    • Points 10

    Problem with Oracle Parameter - not getting whole value of parameter

    Hello, I have come accros this problem, altough I have been using this code before

    I have an oracle command with 1 parameter

    string cmd = " Select value from Database where id = :p1";

     OracleCommand command1 = new OracleCommand ( cmd, connection); OracleParameter p1= new OracleParameter ( "p1", OracleType.Varchar, 8);

     p1.Direction = ParameterDirection.InputOutput; OracleDataReader rdr = null;

    try { connection.Open();

     command.Parameters.Clear();

     command.Parameters.Add(p1);

     p1.Value = id_1;

    command.ExecuteNonQuery();

     rdr = command .ExecuteReader();

     ......

     

    the problem I get is in this line p1.Value=id_1;

    id_1 is a string of max 8 characters,

    and in p1.Value I get just the 1character

     any idea why?

     thanks Probi

    • Post Points: 5
Page 1 of 1 (1 items)