GetString replacement
sobarowski
Posts: 3
I am upgrading an old project to the Redgate DLLs version 11. The code calls ExecutionBlock.GetString, but that method is apparently no longer valid (even though the documentation says to use GetString() in place of ToString()). What should be done to replace the GetString function in the code?
Comments
According to the help CHM contained with the latest SQL Compare SDK release (11.6.11) you should use GetStream() instead:
From the Compare SDK help:
I hope this helps!
Kind regards,
Alex
Have you visited our Help Center?
Right after I posted this, I figured out the GetStream() method, convert that to a string, and everything worked.
Here's the code (VB) in case anyone needs it:
Dim stream As Stream = block.GetStream()
stream.Seek(0, SeekOrigin.Begin)
Dim streamReader As StreamReader = New StreamReader(stream)
Dim strBlock As String = streamReader.ReadToEnd()