I Searched and searched and found no clear answer to this problem.
How to convert array byte to SQLBinary.
I've tried with Narrowing/Widening Operators but nothing seems to work...
Public Shared Widening Operator CType(ByVal p1 As Byte()) As SQLBinary
This throws an error: Error 8 Either the parameter type or the return type of this conversion operator must be of the containing type 'reportManager'. reportManager.ascx.vb 12 37
So how do I go around this and create a function of the sorts that can convert this properly?
Just pass the Byte Array into the constructor:
Dim objSqlBinary As New System.Data.SqlTypes.SqlBinary(myByteArray)
Widening CType Operators require that the class that you define them in be either the return type or what gets converted. I'm assuming you defined that operator in your reportManager.ascx.vb file, which is why its looking for reportManager.