如何在SQL数据库中保存.swf文件格式 [英] How to save .swf file format in SQL Database

查看:142
本文介绍了如何在SQL数据库中保存.swf文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是印度的Badri.我有1个疑问...请给我必要的帮助

如何在SQL数据库中保存.SWF文件格式.

[edit]主题和正文整齐,大写.不要喊.使用所有大写字母被认为是在互联网上大喊大叫,并且粗鲁(使用所有小写字母被认为是幼稚的).如果您想受到重视,请使用适当的大写字母-OriginalGriff [/edit]

Hi,
I am Badri from India. I have 1 doubt ... please give me a needful help

How to save .SWF file format in SQL database.

[edit] Tidied subject, and body, capitalization. DON''T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously - OriginalGriff[/edit]

推荐答案

尝试使用此方法

在SQL中存储和检索doc/pdf/xls文件服务器 [ ^ ]

从SQL Server数据库中保存和检索文件使用ASP.Net [ ^ ]

建议:不建议将文件保存在数据库中,最好是文件夹系统.

涉及将文件存储在数据库中的示例文件系统

将上传的文件存储在数据库或使用ASP.NET 2.0的文件系统中 [
Try this

Storing and Retrieving doc/pdf/xls files in SQL Server[^]

Save and Retrieve Files from SQL Server Database using ASP.Net[^]

Suggestion : Saving Files in database is not advisable, better one is File Folder System.

An example involving storing files in database & File system

Storing Uploaded Files in a Database or in the File System with ASP.NET 2.0[^]


因为.SWF是二进制格式,我建议您先在数据库中创建一个IMAGE字段来保存它. (这是一个很大的二进制字段-大于4000字节).至少,您还应该有一个ID字段(我将使用UniqueIdentifier,但您可以使用自动递增的int(将其创建为int,然后将身份规范"下的(IsIdentity)"设置为是" ,建议使用VARCHAR字段来保存文件名.

然后,您要做的就是在代码中建立与数据库的连接(请参阅SqlConnection @ MSDN),连接INSERT命令(请参阅SqlCommand @ MSDN并尝试使用w3schools以获得Sql语法),然后使用SqlCommand.ExecuteNonQuery方法执行此操作.插入.
Because .SWF is a binary format, I would suggest you start by creating an IMAGE field in your database to hold it. (This is a binary field of large size - greater than 4000 bytes). At a minimum, you should also have an ID field (I would use a UniqueIdentifier, but you could use an auto-incrementing int (create it as an int, and set "(IsIdentity)" under "Identity specification" to "Yes", and I would suggest a VARCHAR field to hold the file name as well.

Then all you have to do is set up a connection to the DB in your code (see SqlConnection @ MSDN), connect an INSERT command (see SqlCommand @ MSDN and try w3schools for Sql syntax) then use the SqlCommand.ExecuteNonQuery method to do the insert.


这篇关于如何在SQL数据库中保存.swf文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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