This is a migrated thread and some comments may be shown as answers.

Image Upload

6 Answers 72 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Duncan
Top achievements
Rank 2
Duncan asked on 09 Nov 2011, 10:41 PM
Does anyone have any information or example code in regards to upload a image using c# to a type:image column in the databases using OpenAccess?

If there is any example code for this i would greatly appreciate it.

Thanks,
Duncan

6 Answers, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 14 Nov 2011, 04:46 PM
Hi Duncan,

In general, the Image data type of MS SQL Server is mapped to a byte[] property in you Domain Class. This array can easily be retrieved by the function ReadFile if you have the file locally. Otherwise, it can be retrieved from the HTTP Request by different file upload controls, including the Uploader control in Rad Controls for ASP.NET AJAX. 

Unfortunately we don't have a full example for this process, but it's a good idea for a new sample that will definitely be considered after the upcoming release.

Do not hesitate to contact us if you have other questions.

Greetings,
Ivailo
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

0
Duncan
Top achievements
Rank 2
answered on 14 Nov 2011, 10:12 PM
I'm actually using RadControls for ASP.NET AJAX. I would love to see a working exampe of an upload and displaying of an image out of the DB using OpenAccess. If anyone else has any input on this, i would greatly appreciate it. Otherwise i look forward to the upcoming releases new samples...

Duncan
0
Ivailo
Telerik team
answered on 17 Nov 2011, 07:38 PM
Hi Duncan,

We are going to notify you on this thread if and when such example is included in our SDK library and is available for download.


Greetings,

Ivailo
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

0
Ivailo
Telerik team
answered on 18 Nov 2011, 12:46 PM
Hi Duncan,

Until we include it in some SDK project, you can use the preliminary version of the sample for reference. Please find it attached, I hope it helps.


Kind regards,
Ivailo
the Telerik team

NEW and UPDATED OpenAccess ORM Resources. Check them out!

0
Duncan
Top achievements
Rank 2
answered on 18 Nov 2011, 04:28 PM
Thanks Ivailo, i'll take a look at this sample. Much appreciate your time on this! Thank you!
0
Erik
Top achievements
Rank 2
answered on 14 Apr 2012, 12:51 PM
Thanks Ivailo & Duncan,

This was what I was looking for.

Took me a while though, some search tags: OpenAccess, ORM, Save Picture, database, SQL Server

Erik
Tags
Development (API, general questions)
Asked by
Duncan
Top achievements
Rank 2
Answers by
Ivailo
Telerik team
Duncan
Top achievements
Rank 2
Erik
Top achievements
Rank 2
Share this question
or