Using classic ASP to save an image into a sql server


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,
Buzoianu AlexAsked:
Who is Participating?
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.