2023 May 18 12:16 PM
Hi Community,
I want to store an excel in our table by converting it into a blob, so i am using byte array and have mapped the blob column to byte array like this
[Column("BLOBCONTENT", TypeName = "blob")]
public byte[] Content { get; set; }
but my code throws error when the file is greater than 9KB
Message=Invalid parameter size value -1. The value must be greater than or equal to 0. (Parameter 'value')
Source=Sap.Data.Hana.Core.v2.1
StackTrace:
at Sap.Data.Hana.HanaParameter.SetSize(Int32 size, String parmName)
at Sap.Data.Hana.HanaParameter.set_Size(Int32 value)
at Sap.EntityFrameworkCore.Hana.Storage.Internal.HanaByteArrayTypeMapping.ConfigureParameter(DbParameter parameter)
at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping.CreateParameter(DbCommand command, String name, Object value, Nullable`1 nullable)
Also, I am using EFCore Version="6.0.2" with net6.0 core for database connection.
Can someone help me figure out the issue and how can I resolve it??
Thanks!
2023 May 18 12:16 PM
Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.
Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.
First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.
I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.
Now for some specific suggestions on how you might improve your question:
* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.
* Share screenshots of what you've seen/done (if possible), as images always helps our members better understand your problem.
* Make sure you've applied the appropriate tags -- because if you don't apply the correct tags, the right experts won't see your question to answer it.
* Use the "insert code" feature when sharing your code, so members have an easier time reading.
Should you wish, you can revise your question by selecting Actions, then Edit.
The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond.
I hope you find this advice useful, and we're happy to have you as part of SAP Community!