How to save images into SQL Server

protected void btnSave_Click(object sender, EventArgs e)
        {
       
//Here convert image into bytes
            Stream fs = FileUpload1.PostedFile.InputStream;

            BinaryReader br = new BinaryReader(fs);

            Byte[] bytes = br.ReadBytes((Int32)fs.Length);

//Now you need to add this byte into your Query.

        }

No comments:

Post a Comment