Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfpoledb and binary parameters
Message
From
02/03/2007 12:56:02
Alan Krack
Mammography Reporting System
Seattle, Washington, United States
 
 
To
28/02/2007 18:31:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01198862
Message ID:
01200344
Views:
32
>>>Alan,
>>>I think I found the reason. Initially I thought it was fault of VFPOLEDB but now I doubt. Looks like a .Net weirdness.
>>>The byte array is passed as null when it's over 8000. Up to 8000 bytes you can pass multiple byte arrays to a procedure.
>>>It works right with ADO even if over 8000 (OTOH it works right with ADO.Net when used with SQLOLEDB if I didn't overlook anything).
>>>
>>
>>
>>Hi Cetin,
>>
>>This is somewhat documented:
>>DbType.Binary
>>A variable-length stream of binary data ranging between 1 and 8,000 bytes.
>>Note ADO.NET cannot correctly infer the type if the byte array is larger than 8,000 bytes. Explicitly specify the DbType when working with byte arrays larger than 8,000 bytes.
>>
>>Perhaps, OleDbType.LongVarBinary should be used.
>>
>>Thanks,
>>Aleksey.
>
>Aleksey,
>It's only documented for DbType.Binary (with a note for larger values as if it would work - oh noticed now that you pasted the note. OK tried that but didn't work).
>However it doesn't work with other types like OleDbType.LongVarBinary (even under 8000 bytes). Internally OleDbType.LongVarBinary sets DbType to DbType.Binary (but then even 500 bytes fail with NULL). Only Binary is working with byte[].
>I'm lost if it's .Net or VFP causing the error.
>Cetin

Thanks guys, I know what the problem is now. If I only send the first 8000 bytes it works fine. I thought maybe I could break it up into multiple parts and send them each as a separate parameter then have the stored procedure put them back together. However, for my average size file, I'd have to send over 50 parameters! Back to the drawing board I guess.

Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform