>When I query my Sql Server table -- the column's data type is data type Sql_VarBinary -- Vfp is converting the value to string implicitly. I need to pass the Sql_VarBinary value to a .Net Com Server as a C# byte array.
>
>I've tried just using the implicitly-converted string in the result set, converting it using CreateBinary(), and passing that, but the COM object: it returns the string 'System.byte[*]' which isn't valid.
>
>The value on the VarBinary field is actually a string that has been encrypted. Converting it to string and then back to varBinary corrupts the value! I need to simply pass a pristine SQL_VarBinary value from the Sql Server column to the C# object as a byte array.
>
>I've also tried using a remove view: DBSetProp (..., "Field", "DataType", "G") ... since DBSetProp doesn't support datatype "Q".
>
>Any ideas, short of writing a custom C# wrapper class, please?
>
>Thanks--
How you take the value from SQL Server?
SPT?
If so BEFORE you run your query try:
CURSORSETPROP("MapBinary",.t.,0)
IF SQLEXEC(.......,...,[YourCursor]) < 0
....
ENDIF
CA?
You could use CursorSchema Set MapBinary = .t.
and use BLOB field in CursorSchema.
RV?
You could MAP the field to BLOB and again use CURSORSETPROP("MapBinary",.t.,0) before open the View.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.