Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Enterprise Library Datatypes
Message
From
27/09/2006 15:13:05
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
 
 
To
27/09/2006 14:56:05
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01157477
Message ID:
01157623
Views:
22
Hey that worked. Thanks for your help Bonnie.

Jim

>I'm assuming the same thing you already have, right?
>
>    database.AddInParameter(command, "@Attachment", DbType.Binary, attachment);
>
>
>~~Bonnie
>
>
>
>\>So what would that look like in terms of the code?
>>
>>>Jim,
>>>
>>>I'm assuming that you tried this and it didn't work? Or were you just asking based on the fact that Intellisense says it's only for binary data between 1 and 8000 bytes? The documentation implies (or rather, I *infer* from the documentation), that it should be ok. Here's what it says:
>>>
>>>A variable-length stream of binary data ranging between 1 and 8,000 bytes.
>>>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.

>>>
>>>~~Bonnie
>>>
>>>
>>>
>>>
>>>>All,
>>>>
>>>> I have a field in a table called attachment of VarBinary(Max) type. From a C# program that uses enterprise library, I am adding an in Parameter. The AddInParameter requires a data type parameter(dbType). What should I use to pass the attachment parameter? The length is usually more than 8,000. I've included my code below. Please help.
>>>>
>>>>
>>>>    DbCommand command = database.GetStoredProcCommand(spName);
>>>>    database.AddOutParameter(command, "@MessageDeliveryDocumentId", DbType.Int32, 0);
>>>>    database.AddInParameter(command, "@MessageDeliveryId", DbType.Int32, messageDeliveryId);
>>>>    database.AddInParameter(command, "@Attachment", DbType.Binary, attachment);
>>>>    database.AddInParameter(command, "@FileName", DbType.String, fileName);
>>>>    database.AddInParameter(command, "@FileType", DbType.String, fileType);
>>>>
Thanks

Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform