Insert image with query into Entity Framework Database in ASP.Net

Last Reply on Mar 16, 2016 06:31 AM By Shashikant

Posted on Mar 16, 2016 06:21 AM

i have these table: 

CREATE TABLE [dbo].[Images] (
    [Id]           INT             IDENTITY (1, 1) NOT NULL,
    [Name]         NVARCHAR (MAX)  NULL,
    [ContentType]  NVARCHAR (MAX)  NULL,
    [Data]         VARBINARY (MAX) NULL,
    [Base64String] NVARCHAR (MAX)  NULL,

Can you help me how to write query to insert image?

You are viewing reply posted by: Shashikant on Mar 16, 2016 06:31 AM.
Posted on Mar 16, 2016 06:31 AM Modified on on Mar 16, 2016 06:45 AM

Please refer below article

Select Insert Edit Update and Delete in GridView using Entity Framework in ASP.Net

also you dont need to Save base64String,as you are saving Data(bytes)

I hope this will help you out.


I agree, here is the link: