如何为byte [] yourPhoto分配路径值不接受 [英] How to assign value of path to byte[] yourPhoto it not accept

查看:50
本文介绍了如何为byte [] yourPhoto分配路径值不接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows表格与2015年工作,我需要更新访问2007中的图像,其中UserID = @ UserID

I work in windows form vs 2015 and i need to update image in access 2007 where UserID=@UserID

 var oleDbConnection = new OleDbConnection(connection);
                    var oleDbCommand = oleDbConnection.CreateCommand();
                    oleDbCommand.CommandText = "Update AllPrinting set  qrimg=@qrimg where UserID=@UserID)";
                    oleDbCommand.Parameters.AddWithValue("@UserID", "UserID");
                    byte[] yourPhoto = path;
                    oleDbCommand.Parameters.AddWithValue("@photo", yourPhoto);
                    using (oleDbConnection)
                    {
                        oleDbConnection.Open();
                        oleDbCommand.ExecuteNonQuery();
                    }

WHEN将路径值分配给 

不接受 

WHEN Assign value of path to 
not accept 

路径变量是字符串,并具有像"d / image";

path variable is string and have the path of image like "d/image";

的图像路径,以便如何分配byte [] yourphoto?

so that how to assign byte[] yourphoto ?

推荐答案

我并没有真正关注你要解决的问题。  你的语法和标点符号会让你难以理解。 (没有冒犯。)

I'm not really following what problem you're trying to solve.  Your grammar and punctuation makes what you're saying hard to follow. (No offense.)

希望下面的链接可以帮助你。

Hope below link can help you.

从MS Access中的OLE对象字段保存并加载图像

Save and load image from OLE Object field in MS Access

http://www.dreamincode.net/forums/topic/349759-save-and-load-image-from-ole-object-field-in-ms-access/ 功能; 

http://www.dreamincode.net/forums/topic/349759-save-and-load-image-from-ole-object-field-in-ms-access/  

您可以为其他任何人提供所有必要的代码段,以便能够从头开始重现您的问题以及有关结果的详细说明,包括任何异常消息。

You can include all necessary code snippets for anyone else to be able to reproduce your issue from scratch along with a detailed description about the results including any exception messages.

最诚挚的问候,

Bob


这篇关于如何为byte [] yourPhoto分配路径值不接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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