Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
In vb.net how to pass the byte() in stored procedure?
Message
From
06/01/2011 01:18:43
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
In vb.net how to pass the byte() in stored procedure?
Miscellaneous
Thread ID:
01494869
Message ID:
01494869
Views:
580
Because i want to do the login page, my table is login(id nvarchar(20), password varbinary(max))
in first , i have already  result  (encryptByte As Byte()  and  hex ) 
           
            Dim encryptByte As Byte() = sqlCmd.ExecuteScalar()
            Dim hex As String = "0x" + BitConverter.ToString(encryptByte).Replace("-", "")

But question is coming, i have StoredProcedure sp_insertLogin... in part 2,
@valueVarbinary < must pass the varbinary, and table field "password" also varbinary that is ok 
But in the first  's result encryptByte(0)> 0 , encryptByte(1)> 0,encryptByte(2)> 0,encryptByte(3)> 123 ....last one is encryptbyte(35)...>197..

           Dim insertLoginCmd As New SqlClient.SqlCommand("sp_insertLogin", cn)
                    insertLoginCmd.CommandType = CommandType.StoredProcedure
                    insertLoginCmd.Parameters.Add("@tablename", SqlDbType.NVarChar).Value = "Login"
                    Dim objinserKeytParameter As SqlParameter = New SqlParameter("@pKey", SqlDbType.NVarChar, 20)
                    insertLoginCmd.Parameters.Add(objinserKeytParameter)
                    objinserKeytParameter.Value = txtid.Text

                    Dim objinsertParameter As SqlParameter = New SqlParameter("@valueVarbinary", SqlDbType.varBinary)
                    insertLoginCmd.Parameters.Add(objinsertParameter)
                    objinsertParameter.Value = encryptByte          '????????My problem in here, if i pass encryptByte the result only take the 0x0 < i feel encryptByte(0), can't take all byte array , if i pass the hex  < error because string , how can i do ???????????????????????????
                    insertLoginCmd.ExecuteNonQuery()
Next
Reply
Map
View

Click here to load this message in the networking platform