Hello,
I have a table in SQL that has Image datatype column.
Now I pass Byte[] array in Parameter for where condition on Image Column but I didn't find any result.
here is my Code.
IN SQL :
SELECT * FROM tblnotifications where CONVERT(VarBinary, img)=( SELECT CONVERT(VarBinary, img) FROM tblnotifications where ID = 2)
This is working fine.
But in C#:
string strExist = "Select * from tblnotifications Where CONVERT(VARBINARY,Mugshot) = @Mugshot";
dbp = new DbParameters();
dbp.SetParameter("@Mugshot", lstXCADData[j].Mugshot, SqlDbType.VarBinary, 16);
DataSet dsExist = Query.DataSet(strExist, dbp, PoolName);
This is not working. so how can I do this.
Loading

Ajay PatelPosted Jan 6, 2014, 1:51 PM
You can't directly compare image datatype. so you can do it by converting image type to nvarchar / varchar type
Ajay PatelPosted Oct 16, 2013, 12:51 AM
Thanks for reply.
I don't think that solution can work. as Binary and varbinary are both BLOB datatype.
SakthisPosted Oct 15, 2013, 5:50 AM