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.
Given this stored procedure:
The following code will execute it, passing NULL if the parameter passed is null:
This test harness
produces the expected results:
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.