我如何可以插入使用ASP.Net SQL Server中的文件? [英] How can I insert a file in SQL Server using ASP.Net?

查看:104
本文介绍了我如何可以插入使用ASP.Net SQL Server中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个ASP.NET应用程序(C#),使用ADO.NET实体框架连接到SQL Server 2008。

I'm developing an ASP.NET app (C#) that connect to SQL Server 2008 using ADO.NET entity framework.

这个应用程序的用户可以选择从自己的本地硬盘驱动器的图像在SQL Server中插入。我怎样才能做到这一点?

The user of this app can select an image from his local hard drive to insert in SQL Server. How can I do this?

我知道如何存储图像到SQL Server,但我不知道如何将图片上传到服务器(使用的FileUpload服务器控件?)。

I know how to store the image into SQL Server but I don't know how to upload the image to the server (using FileUpload server control?).

感谢您!

推荐答案

有关存储上传文件到SQL Server,你可以看看这个回答我的:

For storing uploaded file to SQL server you can look at this answer of mine :

<一个href=\"http://stackoverflow.com/questions/744589/how-do-you-store-a-picture-in-an-image-column/744603#744603\">How你存储的图片在image列?

在这个例子中, uploadInput 是一个文件输入控件,您可以使用它在ASP.NET FileUpload控件。

In this example, uploadInput is a file input control, you can use it as FileUpload control in ASP.NET.

有关使用ASP.NET文件上传控制这里是一个很好的MSDN文章

For using File upload Control in ASP.NET here is a good MSDN article.

这篇关于我如何可以插入使用ASP.Net SQL Server中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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