Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp Com InterOp Passing SQL_VarBinary Value
Message
 
 
To
13/11/2007 12:30:53
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01268674
Message ID:
01268676
Views:
15
To get binary data back as Varbinary/Blob issue once before any SQLEXEC()
CURSORSETPROP("MapBinary", .T., 0)
See MapBinary in the CURSORSETPROP() Function help for details.


>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--
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform