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

Last Reply 11 months ago By Shashikant

Posted 11 months ago

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,
    CONSTRAINT [PK_dbo.Images] PRIMARY KEY CLUSTERED ([Id] ASC)
);

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

You are viewing reply posted by: Shashikant 11 months ago.
Posted 11 months ago Modified on 11 months ago

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: http://e-iceblue.com/free-api