在存储过程中解释byte [] [英] Interpreting byte[] in stored procedure

查看:142
本文介绍了在存储过程中解释byte []的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们通过加密搜索字段并比较这些加密值来搜索加密字段。我需要的是通过实体框架4(通过实体框架4)传递加密值(代码加密),但如果不提供该值,则允许为null。



所以我需要传递一个字节[],但它也需要接受null ...这甚至是可能的,或者如果它不是一个解决方法?再次,我通过实体框架调用存储过程。



谢谢。

解决方案

我们最终通过将其作为一个字符串来进行处理,然后在proc中进行解析。那有效但是我相信我读到的是一个二进制对象,代表byte []数组,而且这也是一样。


A proc we have searches an encrypted field by encrypting the search field and comparing these encrypted values. What I need though to be able to do is to pass into the proc (through Entity Framework 4) the encrypted value (as the code encrypts it), but also allow null if the value is not provided.

So I need to pass in a byte[] but it also needs to accept nulls... is this even possible, or what is a workaround if its not? Again, I'm calling a stored procedure through entity framework.

Thanks.

解决方案

We ended up getting it to work by pushing it as a string, and then parsing it in the proc. That worked. But I believe I read there is a Binary object that represents the byte[] array, and that would have worked too.

这篇关于在存储过程中解释byte []的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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