I follow this link
http://www.aspforums.net/Threads/594197/Get-image-from-Entity-Framework-database-and-send-to-email-in-ASP-NET-MVC/
and give me this error
Server Error in '/' Application.
Value cannot be null.
Parameter name: inArray
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: inArray
Source Error:
Line 22: this.ContentType = baseImages.ContentType;
Line 23: this.Data = baseImages.Data;
Line 24: this.Base64String = Convert.ToBase64String(baseImages.Data);
Line 25: }
Line 26: }
|
i insert image in the database with this insert query
insert into dbo.Images(Name, ContentType, Data)
values('proba', 'jpg',
(select BulkColumn
from Openrowset(Bulk 'c:\images\1_108_1.jpg', Single_Blob) as img))
Can you help me?