public void UploadString(OracleConnection myConnection) { myConnection.Unicode = true; OracleCommand myCommand = new OracleCommand("INSERT INTO Test.TextBlocks (BlockID, BlockName, BlockContent) VALUES(1,'First',:BlockText)", myConnection); myCommand.Parameters.Add("BlockText",OracleDbType.VarChar,50).Value = "Place here some text that requires Unicode support."; myConnection.Open(); try { Console.WriteLine(myCommand.ExecuteNonQuery()+" rows affected."); } finally { myConnection.Close(); } } public void DownloadString(OracleConnection myConnection) { myConnection.Unicode = true; OracleCommand myCommand = new OracleCommand("SELECT * FROM Test.TextBlocks", myConnection); myConnection.Open(); OracleDataReader myReader = myCommand.ExecuteReader(CommandBehavior.Default); try { while (myReader.Read()) { string myString = (string)myReader["BlockContent"]; Console.WriteLine(myString); } } finally { myReader.Close(); myConnection.Close(); } }
Public Sub UploadString(ByVal myConnection As OracleConnection) myConnection.Unicode = True Dim myCommand As New OracleCommand("INSERT INTO Test.TextBlocks (BlockID, BlockName, BlockContent) VALUES(1,'First',:BlockText)", myConnection) myCommand.Parameters.Add("BlockText", OracleDbType.VarChar, 50).Value = "Place here some text that requires Unicode support." myConnection.Open() Try Console.WriteLine(String.Concat(myCommand.ExecuteNonQuery(), " rows affected.")) Finally myConnection.Close() End Try End Sub Public Sub DownloadString(ByVal myConnection As OracleConnection) myConnection.Unicode = True Dim myCommand As New OracleCommand("SELECT * FROM Test.TextBlocks", myConnection) myConnection.Open() Dim myReader As OracleDataReader = myCommand.ExecuteReader(CommandBehavior.Default) Try While myReader.Read() Dim myString As String = CType(myReader("BlockContent"), String) Console.WriteLine(myString) End While Finally myReader.Close() myConnection.Close() End Try End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2