使用保存按钮单击将文件格式路径保存到sql数据库 [英] Save a file form path to sql databse using save button click

查看:60
本文介绍了使用保存按钮单击将文件格式路径保存到sql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在表格上创建。

控制如下。



txtPathfile - 文本框

cmdUpload - 按钮

opendialoguebox1- opendialoguebox



我能够将上传文件的路径输入到txtPathfile.text



但我无法将文件/图像等文件保存到sql数据库中。 />


请帮帮我。





rajug

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

推荐答案

创建一个带有一个参数的存储过程,并将txtPathfile的值传递给参数。



如果你想要的话要更新现有记录,请使用如下更新语句:



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:

update TABLENAME set FIELDNAME = @P_PathFile





如果你想要inser进入一个新记录,使用这样的插入语句:





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

insert into TABLENAME (FIELD1, FIELD2,...,FIELDN) values (VALUE1, VALUE2, ..., VALUEN)


Hii ...

尝试这个,它可能对你有用。



如何存储&使用asp.net c#在mysql数据库中检索图像[ ^ ]



谢谢你。
Hii...
try this one,its may useful to u.

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

thank u.


这篇关于使用保存按钮单击将文件格式路径保存到sql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆