Using classic ASP to save an image into a sql server

Buzoianu Alex
Buzoianu Alex used Ask the Experts™

The prolema that I encounter is related to classical programming.
I want to upload an image (jpeg, gif etc) into the sql server. We did not succeed with all our efforts. If you can help me, I will remain eternally grateful
All right,
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You never uploaded the image contents to the database. That's just the file name.

In your application, you would upload this to the database following this format:

byte[] image = File.ReadAllBytes("D:\\11.jpg");

SqlCommand sqlCommand = new SqlCommand("INSERT INTO imageTest (pic_id, pic) VALUES (1, @Image)", yourConnectionReference);
sqlCommand.Parameters.AddWithValue("@Image", image);

Open in new window

how you know what he did or what he didnt? I do not see any attached code or example of what he tried.

There is no activity from author.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial