CharlieDev
asked on
c#, asp.net- help with basic photo uploader
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.ApplicationBlock s.Data
DBConnect.OpenConnection() ;
SqlCommand commandaddEvent = new SqlCommand("exec usp_AddPhoto @Photo", DBConnect.conn);
commandaddEvent.Parameters .Add("Phot o", SqlDbType.UniqueIdentifier );
commandaddEvent.Parameters ["Photo"]. Value = photo;
commandaddEvent.ExecuteNon Query();
DBConnect.CloseConnection( );
//Simple procedure
/*CREATE PROCEDURE sp_img(@img image) AS
insert into tb_img values(@img)*/
//record data
SqlHelper.ExecuteNonQuery( connection String,"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
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.ApplicationBlock
DBConnect.OpenConnection()
SqlCommand commandaddEvent = new SqlCommand("exec usp_AddPhoto @Photo", DBConnect.conn);
commandaddEvent.Parameters
commandaddEvent.Parameters
commandaddEvent.ExecuteNon
DBConnect.CloseConnection(
//Simple procedure
/*CREATE PROCEDURE sp_img(@img image) AS
insert into tb_img values(@img)*/
//record data
SqlHelper.ExecuteNonQuery(
What variable or reference is the image for me to reference to photo in the following line?: commandaddEvent.Parameters
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I wont store the files in the database then! So I'll need some help to store them elsewhere. I'll post a new question and hope you'll help with that!! :)
Thanks