Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ORACLE / ADO .NET: TNS: Packet Writer Failure in parameterized query

ORACLE / ADO .NET: TNS: Packet Writer Failure in parameterized query

Scheduled Pinned Locked Moved Database
databasecsharporaclevisual-studiosysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    slvrscremr
    wrote on last edited by
    #1

    There's got to be something wrong with what I'm doing. The database responds fine with the following code: :) ** Bracketed code is edited to protect the innocent **

    Imports System Imports System.Data.OracleClient Public Class Driver Public Shared Sub Main() Dim conn as New OracleConnection conn.ConnectionString = "Data Source=[DBName]; User Id=[User Id]; Password=[Password]" Dim cmd as New OracleCommand cmd.CommandText = "SELECT * FROM USERS WHERE USER_ID = '[USER_ID]'" cmd.Connection = conn cmd.CommandType = CommandType.Text Try Dim odr as OracleReader odr = cmd.ExecuteReader() Catch ex As Exception Console.Writeline( ex.Message ) End End Sub End Class

    Now, upon replacing :

    cmd.CommandText = "SELECT * FROM USERS WHERE USER_ID = '[USER_ID]'"

    with a parameterized query like :

    cmd.CommandText = "SELECT * FROM USERS WHERE USER_ID = :pUserId" cmd.Parameters.Add( new OracleParameter( ":pUserId", OracleType.VarChar )).Value = "[USER_ID]" )

    results in the return of a ORA-12571 : TNS:Packet Writer Failure :( I've tried most everything I can think of and I can't around this. :confused: The environment is Windows 2000 Server, Oracle 9i, and VS 2003. Thanks in advance, Darien "I don't know. I haven't tried today." - Trumpet icon Maynard Ferguson's response when asked how high he could play.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups