Sorry , i also find the same problem ....
i want to use stored procedure to do this , but also same problem....
my code is... (in this the program said the returnValue can not 'System.Int32' convert to'System.Byte[], but i use the VarBinary ,it also change to int,
Is not StoredProcedure return value must integer , then how can i do, thx~~~?)
Dim sqlCmd As New SqlCommand
sqlCmd.Connection = cn
sqlCmd.CommandType = CommandType.StoredProcedure
sqlCmd.CommandText = "dbo.sp_encrypt"
Dim inputValue As SqlParameter = sqlCmd.Parameters.Add("@word", SqlDbType.NVarChar)
inputValue.Value = Adjust_SQL(TextBox1.Text)
Dim ReturnValue As SqlParameter = sqlCmd.Parameters.Add("ReturnValue", SqlDbType.VarBinary)
ReturnValue.Direction = ParameterDirection.ReturnValue
sqlCmd.ExecuteNonQuery()
Dim hex As String = "0x" + BitConverter.ToString(ReturnValue.Value).Replace("-", "")
< in this the program said the returnValue can not 'System.Int32' convert to'System.Byte[], but i use the VarBinary ,it also change to int,
Is not StoredProcedure return value must integer , then how can i do, thx~~~?)
TextBox1.Text = hex