Click here to Skip to main content
15,890,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Is there any library to compare 2 sql server databases ? Pin
satc27-Jul-15 4:07
satc27-Jul-15 4:07 
GeneralRe: Is there any library to compare 2 sql server databases ? Pin
Sascha Lefèvre27-Jul-15 4:31
professionalSascha Lefèvre27-Jul-15 4:31 
GeneralRe: Is there any library to compare 2 sql server databases ? Pin
satc27-Jul-15 19:48
satc27-Jul-15 19:48 
QuestionCrazy ODBCDataReader Pin
Marcus Genovese24-Jul-15 4:12
Marcus Genovese24-Jul-15 4:12 
AnswerRe: Crazy ODBCDataReader Pin
Richard Deeming24-Jul-15 4:49
mveRichard Deeming24-Jul-15 4:49 
GeneralRe: Crazy ODBCDataReader Pin
Marcus Genovese24-Jul-15 5:25
Marcus Genovese24-Jul-15 5:25 
QuestionHow to write Worksheet Change Event in Visual Studio 2010??? Pin
Member 1184098123-Jul-15 21:27
Member 1184098123-Jul-15 21:27 
QuestionOracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal22-Jul-15 12:48
Aaron Rosenthal22-Jul-15 12:48 
I am trying to read a CLOB value from an Oracle database query using the GetChars method. I am doing this so that I can buffer very large CLOB values and write the results out to an XML file.

However, there seems to be an issue where the GetChars method of an OracleDataReader is only buffering half the characters it should. This causes me to continue buffering in a loop until GetChars returns 0, but I think this is very inefficient and is slowing down my program.

Does anyone know why this is happening? Here is the fragment of code that I am using:

VB
Dim reader As Data.OracleClient.OracleDataReader
Dim bufferSize As Integer = 1024 * 2000
Dim outChar(bufferSize - 1) As Char

Using connection As New Data.OracleClient.OracleConnection(connectString)
    Dim command As New Data.OracleClient.OracleCommand(statement)
    command.Connection = connection

    connection.Open()
    reader = command.ExecuteReader(System.Data.CommandBehavior.SequentialAccess)

    Do While reader.Read()
        ' Reset the starting char for a new CLOB
        startIndex = 0
        Array.Clear(outChar, 0, bufferSize)

        ' Read chars into outChar() and retain the number of bytes returned
        retval = reader.GetChars(0, startIndex, outChar, 0, bufferSize)
        Do Until retval = 0
            rawStr = New String(outChar)
            rawStr = rawStr.Replace(Chr(0), "")

            myxml.WriteRaw(rawStr)
            myxml.Flush()

            startIndex += rawStr.Length
            Array.Clear(outChar, 0, bufferSize)
            retval = reader.GetChars(0, startIndex, outChar, 0, bufferSize)
        Loop
    Loop
End Using

AnswerRe: OracleDataReader GetChars method only buffering half the characters Pin
Eddy Vluggen22-Jul-15 23:33
professionalEddy Vluggen22-Jul-15 23:33 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 2:03
Aaron Rosenthal23-Jul-15 2:03 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Eddy Vluggen23-Jul-15 2:13
professionalEddy Vluggen23-Jul-15 2:13 
AnswerRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 2:20
mveRichard Deeming23-Jul-15 2:20 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 3:36
Aaron Rosenthal23-Jul-15 3:36 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 3:56
mveRichard Deeming23-Jul-15 3:56 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 4:24
Aaron Rosenthal23-Jul-15 4:24 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 4:51
mveRichard Deeming23-Jul-15 4:51 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 6:11
Aaron Rosenthal23-Jul-15 6:11 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 6:20
mveRichard Deeming23-Jul-15 6:20 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 6:24
Aaron Rosenthal23-Jul-15 6:24 
SuggestionRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 6:25
mveRichard Deeming23-Jul-15 6:25 
AnswerRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 6:37
mveRichard Deeming23-Jul-15 6:37 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Aaron Rosenthal23-Jul-15 8:02
Aaron Rosenthal23-Jul-15 8:02 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Eddy Vluggen23-Jul-15 9:19
professionalEddy Vluggen23-Jul-15 9:19 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Richard Deeming23-Jul-15 9:50
mveRichard Deeming23-Jul-15 9:50 
GeneralRe: OracleDataReader GetChars method only buffering half the characters Pin
Eddy Vluggen23-Jul-15 10:27
professionalEddy Vluggen23-Jul-15 10:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.