This is a much more detail explanation of how to do so http://ripalsoni.wordpress.com/2008/07/24/how-do-i-read-write-oracle-clob-data-in-aspnet-or-vbnet/
Step 1: Add a reference – Oracle.Dataaccess.dll ( found in ODP.NET )
Step 2: Imports following namespaces
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types
Step 3: Create a connection string
Public ReadOnly connectionstring = "data source = oradb;user id = rmsoni;password=rmsoni99"
Step 4: Create Following Public Methods
Public Sub ReadLOBData()
Dim con As New OracleConnection(connectionstring)
con.Open()
Dim sql As String = "select CLOBTEXTFIELD from TestCLOB where ID=1"
Dim cmd As OracleCommand = New OracleCommand(sql, con)
Dim dr As OracleDataReader = cmd.ExecuteReader()
dr.Read()
Dim blob As OracleClob = dr.GetOracleClob(0)
txtOutput.Text = blob.Value()
blob.Close()
dr.Close()
con.Close()
End Sub
Complete Source Code –
Public Sub WriteLOBData()
Dim connection As New OracleConnection(connectionstring)
connection.Open()
Dim strSQL As String = "INSERT INTO TestCLOB (ID,CLOBTEXTFIELD) VALUES (1,:TEXT_DATA) "
Dim paramData As New OracleParameter
paramData.Direction = ParameterDirection.Input
paramData.OracleDbType = OracleDbType.Clob
paramData.ParameterName = "TEXT_DATA"
paramData.Value = txtInput.Text
Dim cmd As New OracleCommand
cmd.Connection = connection
cmd.Parameters.Add(paramData)
cmd.CommandText = strSQL
cmd.ExecuteNonQuery()
paramData = Nothing
cmd = Nothing
connection.Close()
End Sub