请求源代码 [英] Request For Source Code

查看:112
本文介绍了请求源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请发送代码以使用MS-Access和VB.net在数据库中存储和检索图像

Please Send a code to store and Retrieve images using MS-Access and VB.net in a database

推荐答案

我认为您不需要代码:也一样,因为我不会为您做功课.
它确实并不复杂或困难:

1)在一个表中创建一个列,该表是一个OleObject字段.
2)使用OpenFileDialog类找到文件.
3)使用File.ReadAllBytes方法读取文件.
4)使用OleDbCommand上的参数化查询将行插入数据库.
要读取它,请从数据库读取它(再次使用OleDbCommand,这次是将其读取到OleDbReader中),然后使用File.WriteAllBytes方法保存字节.
如果您不了解其中任何一项,请尝试使用Google不了解的内容-如果您自己进行了解,将会学到很多东西.
I don''t think you need the code: which is just as well, since I''m not going to do your homework for you.
It really isn''t complicated or difficult:

1) Create a column in a table which is an OleObject field.
2) Locate the file using the OpenFileDialog class.
3) Read the file using the File.ReadAllBytes method.
4) Insert the row to the database using a Parametrized query on a OleDbCommand.

To read it out, read it from the db (again using an OleDbCommand, this time into a OleDbReader) and save the bytes using the File.WriteAllBytes method.

If you don''t understand any of this, try Googling the bit you don''t understand - you will learn a lot better if you do it yourself.


这篇关于请求源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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