troubleshooting Question

c#, asp.net- help with basic photo uploader

Avatar of CharlieDev
CharlieDevFlag for United Kingdom of Great Britain and Northern Ireland asked on
C#ASP.NET
2 Comments1 Solution236 ViewsLast Modified:
Hi,
I am trying to get a basic photo uploader working to see how it works. I'm using the tutorial : http://www.codeproject.com/KB/aspnet/simpleuploadimage.aspx

I am having troubles with  adding the image to the database using the stored proceedure, so I want to change the code on the site to add:

   //Execute the procedure with Microsoft.ApplicationBlocks.Data
            DBConnect.OpenConnection();

            SqlCommand commandaddEvent = new SqlCommand("exec usp_AddPhoto @Photo", DBConnect.conn);

            commandaddEvent.Parameters.Add("Photo", SqlDbType.UniqueIdentifier);
            commandaddEvent.Parameters["Photo"].Value = photo;
           
            commandaddEvent.ExecuteNonQuery();

            DBConnect.CloseConnection();


            //Simple procedure

            /*CREATE PROCEDURE sp_img(@img image)  AS

            insert into tb_img values(@img)*/

            //record data

            SqlHelper.ExecuteNonQuery(connectionString,"sp_img",obj);    

What variable or reference is the image for me to reference to photo in the following line?:   commandaddEvent.Parameters["Photo"].Value = photo;
Thanks
ASKER CERTIFIED SOLUTION
apresto

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros