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

Last Reply 10 months ago By Shashikant

Posted 10 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,

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

Posted 10 months ago Modified on 10 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: