Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi All,

I have created on form.
Controls are as follows.

txtPathfile - text box
cmdUpload - button
opendialoguebox1- opendialoguebox

I able to do getting path of the uploaded file in to the txtPathfile.text

but i cannot save that file like documents/images...into sql database.

Please help me.


rajug
Posted
Updated 30-May-13 3:10am
v4
Comments
What have you tried ? And in which technology ?
Please tag your question with correct tech. tags ?
rajugknr 30-May-13 2:32am    
If I used "update TABLENAME set FIELDNAME = @P_PathFile" is this code can save the file in to the sql database
If you want to save you should use INSERT statement and if you want update, then you should use UPDATE statement.
rajugknr 30-May-13 2:43am    
I am using windows application with C# language.
I need to save the uploaded file into the sql database using file full path that is on one textbox control.

Create a stored procedure that takes one parameter, and pass the value of the txtPathfile into the parameter.

If you are wanting to update an existing record, use an update statement like this:

SQL
update TABLENAME set FIELDNAME = @P_PathFile


If you are wanting to insert into a new record, use an insert statement like this:

SQL
insert into TABLENAME (FIELD1, FIELD2,...,FIELDN) values (VALUE1, VALUE2, ..., VALUEN)
 
Share this answer
 
Hii...
try this one,its may useful to u.

How to store & retrieve images in mysql database using asp.net c#[^]

thank u.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900