I want to create an SQL string that evaluates a binary field.
But I get the wrong data
This is probably because I use the wrong technique for reading the binary data.
The current function looks like this:
Private Function GetSQLValue( sValue As RedGate.SQLDataCompare.Engine.FieldPair,
row As RedGate.SQLDataCompare.Engine.ResultsStore.Row
) As String
Dim field1 As Int32 = sValue.OrdinalInResults1
Dim sRes As String = ""
Select Case Val(sValue.Type1)
Case 14 'binary
Dim blob1 As Blob = CType(row.Values(field1), Blob)
Dim I As Int32
For I = 0 To blob1.Length - 1
sRes += blob1.ByteArray(I).ToString
Next
sRes += " "
End Select
Return sRes
End Function
But I get the wrong data
This is probably because I use the wrong technique for reading the binary data.
The current function looks like this:
Private Function GetSQLValue( sValue As RedGate.SQLDataCompare.Engine.FieldPair, row As RedGate.SQLDataCompare.Engine.ResultsStore.Row ) As String Dim field1 As Int32 = sValue.OrdinalInResults1 Dim sRes As String = "" Select Case Val(sValue.Type1) Case 14 'binary Dim blob1 As Blob = CType(row.Values(field1), Blob) Dim I As Int32 For I = 0 To blob1.Length - 1 sRes += blob1.ByteArray(I).ToString Next sRes += " " End Select Return sRes End Function