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:
01268675
Views:
12
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform