juturu madhu sudana rao
New member
- Joined
- Mar 29, 2006
- Messages
- 1
- Programming Experience
- Beginner
HI,
i have done store into sqlserver database using vb.net application
the following code i was inserted into database.
Dim con As SqlConnection
Dim objcmd As SqlCommand
Dim sqlcmd As String
Dim result As Byte()
Dim salt(8) As Byte
Dim intermediate As String
Dim test As String = txtPassword.Text
Try
Dim sha As SHA1
sha = New SHA1CryptoServiceProvider
Dim rng As RNGCryptoServiceProvider
rng = New RNGCryptoServiceProvider
rng.GetBytes(salt)
intermediate = Convert.ToBase64String(salt) + test
result = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(intermediate))
MsgBox(Convert.ToBase64String(result))
Catch ce As CryptographicException
MsgBox(ce.Message)
End Try
con = New SqlConnection("server=localhost;uid=sa;password=cbl;database=msr")
con.Open()
sqlcmd = "INSERT INTO hashpass(username,password)VALUES (@Username, @Pass)"
objcmd = New SqlCommand(sqlcmd, con)
objcmd.Parameters.Add("@Username", txtUsername.Text)
objcmd.Parameters.Add("@pass", result)
objcmd.ExecuteNonQuery()
con.Close()
----
now i want retrieve data from sqlserver database in vb.net application
please sent me the above problem
tq
j madhu
i have done store into sqlserver database using vb.net application
the following code i was inserted into database.
Dim con As SqlConnection
Dim objcmd As SqlCommand
Dim sqlcmd As String
Dim result As Byte()
Dim salt(8) As Byte
Dim intermediate As String
Dim test As String = txtPassword.Text
Try
Dim sha As SHA1
sha = New SHA1CryptoServiceProvider
Dim rng As RNGCryptoServiceProvider
rng = New RNGCryptoServiceProvider
rng.GetBytes(salt)
intermediate = Convert.ToBase64String(salt) + test
result = sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(intermediate))
MsgBox(Convert.ToBase64String(result))
Catch ce As CryptographicException
MsgBox(ce.Message)
End Try
con = New SqlConnection("server=localhost;uid=sa;password=cbl;database=msr")
con.Open()
sqlcmd = "INSERT INTO hashpass(username,password)VALUES (@Username, @Pass)"
objcmd = New SqlCommand(sqlcmd, con)
objcmd.Parameters.Add("@Username", txtUsername.Text)
objcmd.Parameters.Add("@pass", result)
objcmd.ExecuteNonQuery()
con.Close()
----
now i want retrieve data from sqlserver database in vb.net application
please sent me the above problem
tq
j madhu