I have an image serialized in an array of Bytes in C# - UWP, here is the post: How to serialize an image (bitmap) in bytes[ ] C# UWP?
but now I have to save it in a Database in SQL and I don't know what field to use for that.
Thank you
I have an image serialized in an array of Bytes in C# - UWP, here is the post: How to serialize an image (bitmap) in bytes[ ] C# UWP?
but now I have to save it in a Database in SQL and I don't know what field to use for that.
Thank you
I don't know why they rate me badly, but for all the gritty ones this is the answer: What you have to do is create a field in the database table
varbinary
. Then the image that is in bytes is converted into string64 and thus it is saved in the BDAnd when it has to be brought back, it is deconverted from string64 to Bytes[ ]
To understand the fields, review the question where I serialize Image to Bytes in UWP. How to serialize an image (bitmap) in bytes[ ] C# UWP?
thanks for nothing
Try this, suppose you want to load an image: (img is your file) also clarify that you are working with C# MVC EntityFramework
This is the way:
the in your Class must declare a property as a byte array example like this:
you can use the dbContext to save the SQLServer database