How to pass SqlDbType.Varbinary field (using Eval) to C# method in .NET? -
How to pass SqlDbType.Varbinary field (using Eval) to C# method in .NET? -
in aspx code have (devexpress image control):
<dx:aspxbinaryimage value='<%# getphoto(eval("photo")) %>' id="binaryimagepreview" runat="server" clientidmode="autoid" width="100px" />
then in code behind have this:
protected static byte[] getphoto(byte[] photo) { homecoming photo; }
my table column photo of type varbinary(max) reading sqldbtype.varbinary mapped byte[] there shouldn't problems here, compiler throws error:
the best overloaded method match 'storeprofile.admin.getphoto(byte[])' has invalid arguments
why?
the reason want is check if photo exists (is null), show default photo disk, no_photo.jpg.
uh, ok. missing casting. calling method way solved problem:
getphoto((byte[])eval("photo"))
c# .net eval photo varbinary
Comments
Post a Comment