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

Visual Basic

 
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 
OK, so try an Array.IndexOf call to find the index of the first null character:
VB.NET
retval = reader.GetChars(0, startIndex, outChar, 0, bufferSize)
Do Until retval = 0
    Dim nullIndex = Array.IndexOf(outChar, Chr(0), 0, retval)
    If nullIndex = -1 Then nullIndex = retval
    
    myxml.WriteRaw(outChar, 0, nullIndex)
    myxml.Flush()
    
    startIndex += retval
    Array.Clear(outChar, 0, retval)
    retval = reader.GetChars(0, startIndex, outChar, 0, bufferSize)
Loop

That will perform a linear search on the array, but it will be much faster than creating a string containing a complete copy of the array, then iterating through every character in the string, copying every non-null character to a new string.

If the retval value is incorrect, you might also need to adjust the increment of the startIndex variable; otherwise, you might be skipping characters. You'd need to compare the final output with the database column to see if that's the case.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


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 
QuestionHow to rename texts in a Standart Browse File / Browse Folder Dialog Pin
satc22-Jul-15 4:14
satc22-Jul-15 4:14 
AnswerRe: How to rename texts in a Standart Browse File / Browse Folder Dialog Pin
Eddy Vluggen22-Jul-15 4:38
professionalEddy Vluggen22-Jul-15 4:38 
GeneralRe: How to rename texts in a Standart Browse File / Browse Folder Dialog Pin
satc22-Jul-15 20:02
satc22-Jul-15 20:02 
GeneralRe: How to rename texts in a Standart Browse File / Browse Folder Dialog Pin
Eddy Vluggen22-Jul-15 21:40
professionalEddy Vluggen22-Jul-15 21:40 
QuestionA validation information inside a zip file Pin
satc22-Jul-15 2:43
satc22-Jul-15 2:43 
AnswerRe: A validation information inside a zip file Pin
Eddy Vluggen22-Jul-15 3:51
professionalEddy Vluggen22-Jul-15 3:51 
AnswerRe: A validation information inside a zip file Pin
Dave Kreskowiak22-Jul-15 3:53
mveDave Kreskowiak22-Jul-15 3:53 
GeneralRe: A validation information inside a zip file Pin
satc26-Jul-15 0:11
satc26-Jul-15 0:11 
GeneralRe: A validation information inside a zip file Pin
Dave Kreskowiak26-Jul-15 3:39
mveDave Kreskowiak26-Jul-15 3:39 
QuestionHelp with datetime Pin
jkirkerx21-Jul-15 10:58
professionaljkirkerx21-Jul-15 10:58 

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.