Print Page | Close Window

How to compare byte data

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2785
Printed Date: 15-Oct-2026 at 4:45pm


Topic: How to compare byte data
Posted By: vinothvdp
Subject: How to compare byte data
Date Posted: 21-Jun-2011 at 7:09am
Hi,

How to use where condition on byte data field, i have varbinary(50) database field,
how can use filter for this field?

Thanks in Advance.





Replies:
Posted By: sbelini
Date Posted: 21-Jun-2011 at 12:45pm
Hi vinothvdp,
It appears, that binary data field could not compared directly in Linq to Sql.
 
You might want to take a look at
http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/f90dec50-acc7-4157-8927-acb246ec3572 - http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/f90dec50-acc7-4157-8927-acb246ec3572
http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions/suggestions/1050327-linq-support-for-comparison-of-varbinary-columns?ref=title - http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions/suggestions/1050327-linq-support-for-comparison-of-varbinary-columns?ref=title
 
Regards,
   Silvio.


Posted By: vinothvdp
Date Posted: 28-Jun-2011 at 7:24am
HI,

Thanks for your quick replay.

Now i have issue,i need to pass byte[] data(scanned image) to procedure parameter, how can i pass this?

my procedure has varbinary(max) parameter how do i pass this value to sp?

My Procedure Is 

ALTER PROCEDURE [dbo].[imagematch](@match varbinary(max))
AS
BEGIN
select * from dbo.image  where cast(image1 as nvarchar(max))=cast(@match  as nvarchar(max))
END


Please help me out this...

Thanks in advance.




Posted By: sbelini
Date Posted: 01-Jul-2011 at 9:56am
What exactly is the issue you're coming across?
 
You should be able to call
EntityManager.MyStoredProc(myByteArrayParameter).Execute()
 
You might want to take a look at the DevForce Resource Center section about http://drc.ideablade.com/xwiki/bin/view/Documentation/stored-procedure-queries - StoredProc Queries . (there's also a sample/walkthrough http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-stored-procedure-queries-silverlight - here )
 
Silvio.



Print Page | Close Window