c# - array of bytes to SQL Server -


how pass array of bytes c# windows application sql server via stored procedure? code in sql :

        insert pers_usermachine (userid,nboftemplates,fingerprint1,fingerprint2,fingerchecksum1,fingerchecksum2)          values(             @userid,                         @nboftemplates,             convert(varbinary(max),@fingerprint1),             convert(varbinary(max),@fingerprint2),             @fingerchecksum1,             @fingerchecksum2                 ) 

and code in c#:

    public int saveuser(int id, string userid, int nboftemplates, byte [] fingerprint1, byte [] fingerprint2, int32 fingerchecksum1, int32 fingerchecksum2)     {         try         {             hybriddictionary paramsdictionary = new hybriddictionary();              paramsdictionary.add("@id", id);             paramsdictionary.add("@userid", userid);             paramsdictionary.add("@nboftemplates", nboftemplates);             paramsdictionary.add("@fingerprint1", fingerprint1);             paramsdictionary.add("@fingerprint2", fingerprint2);             paramsdictionary.add("@fingerchecksum1", fingerchecksum1);             paramsdictionary.add("@fingerchecksum2", fingerchecksum2);              dabase da = new dabase();             return int.parse(da.getscalar("punchmachinesaveuser", paramsdictionary).tostring());         }         catch (exception ex)         {             return -1;         }     } 


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -