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

Last Reply one year ago By Shashikant

Posted one year 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,

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

Posted one year ago Modified on one year 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: