Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql2005 EncryptByPassPhrase binary problem
Message
De
02/01/2011 22:25:35
 
 
À
31/12/2010 05:08:22
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01494217
Message ID:
01494374
Vues:
38

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

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform