The data type is System.Byte[] because in the database is expected a varbinary. This code is on the function addTemplate on the class DBClass