Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql2005 EncryptByPassPhrase binary problem
Message
From
02/01/2011 22:25:35
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01494217
Message ID:
01494374
Views:
37

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

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform