Click here to Skip to main content
15,887,746 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Calender Pop Up and master Page Problem Pin
kidus111-Jul-07 11:52
kidus111-Jul-07 11:52 
GeneralRe: Calender Pop Up and master Page Problem Pin
kidus111-Jul-07 11:53
kidus111-Jul-07 11:53 
GeneralRe: Calender Pop Up and master Page Problem Pin
kjosh11-Jul-07 12:10
kjosh11-Jul-07 12:10 
GeneralRe: Calender Pop Up and master Page Problem Pin
kidus112-Jul-07 2:11
kidus112-Jul-07 2:11 
GeneralRe: Calender Pop Up and master Page Problem Pin
Member 186252323-Aug-08 22:55
Member 186252323-Aug-08 22:55 
QuestionMapping database fileds Pin
patelash0111-Jul-07 10:21
patelash0111-Jul-07 10:21 
AnswerRe: Mapping database fileds Pin
Paul Conrad13-Jul-07 12:19
professionalPaul Conrad13-Jul-07 12:19 
Questionhash and salt Pin
boyindie11-Jul-07 8:58
boyindie11-Jul-07 8:58 
Hi
I have been playing around with a password hashing scheme for my application

But i keep getting an error message when it executes the command object

i get the error

Unable to cast object of type 'System.byte[]' to type 'system.inconvertible'

Any suggestions?

Sub CreateAccount(ByVal sender As Object, ByVal e As EventArgs)
Dim literror As New LiteralControl
'1. Create a connection
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=localhost; ;database=ftp1;"

'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
Try
'2. Create a command object for the query
Dim strSQL As String = _
"INSERT INTO Useraccount(Username,Password) " & _
"VALUES(?Username, ?Password)"
Dim objCmd As New MySqlCommand(strSQL, connection)

'3. Create parameters
Dim paramUsername As MySqlParameter
paramUsername = New MySqlParameter("?Username", SqlDbType.VarChar, 25)
paramUsername.Value = txtUsername.Text
objCmd.Parameters.Add(paramUsername)


'Encrypt the password
Dim md5Hasher As New MD5CryptoServiceProvider()

Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding()

hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes(txtPwd.Text))

Dim paramPwd As MySqlParameter
paramPwd = New MySqlParameter("?Password", SqlDbType.Binary, 16)
paramPwd.Value = hashedBytes
objCmd.Parameters.Add(paramPwd)


'Insert the records into the database
connection.Open()
objCmd.ExecuteReader()
connection.Close()
Catch ex As Exception
literror.Text = ex.Message
MsgBox(ex.Message)

End Try
Response.Redirect("userhome.aspx")

End Sub

AnswerBAD USER! Pin
leckey11-Jul-07 9:16
leckey11-Jul-07 9:16 
AnswerRe: hash and salt Pin
Dave Kreskowiak11-Jul-07 9:28
mveDave Kreskowiak11-Jul-07 9:28 
GeneralRe: hash and salt Pin
boyindie11-Jul-07 22:38
boyindie11-Jul-07 22:38 
GeneralRe: hash and salt Pin
Dave Kreskowiak12-Jul-07 1:41
mveDave Kreskowiak12-Jul-07 1:41 
AnswerRe: hash and salt Pin
Pete O'Hanlon11-Jul-07 10:27
mvePete O'Hanlon11-Jul-07 10:27 
GeneralRe: hash and salt Pin
leckey11-Jul-07 15:00
leckey11-Jul-07 15:00 
GeneralRe: hash and salt Pin
Sathesh Sakthivel11-Jul-07 17:58
Sathesh Sakthivel11-Jul-07 17:58 
QuestionChart Refresh Problem Pin
Hyland Computer Systems11-Jul-07 8:10
Hyland Computer Systems11-Jul-07 8:10 
AnswerRe: Chart Refresh Problem Pin
Michael Sync11-Jul-07 8:22
Michael Sync11-Jul-07 8:22 
GeneralRe: Chart Refresh Problem Pin
Hyland Computer Systems12-Jul-07 5:44
Hyland Computer Systems12-Jul-07 5:44 
QuestionOpen New window with some parameter Pin
Sarfaraj Ahmed11-Jul-07 4:59
Sarfaraj Ahmed11-Jul-07 4:59 
AnswerRe: Open New window with some parameter Pin
Michael Sync11-Jul-07 8:13
Michael Sync11-Jul-07 8:13 
QuestionChanging skins at runtime [modified] Pin
dandy7211-Jul-07 4:19
dandy7211-Jul-07 4:19 
AnswerRe: Changing skins at runtime Pin
Michael Sync11-Jul-07 8:10
Michael Sync11-Jul-07 8:10 
GeneralRe: Changing skins at runtime Pin
dandy7212-Jul-07 4:27
dandy7212-Jul-07 4:27 
QuestionDisplay Multiple Columns in a List Box Pin
kibromg11-Jul-07 4:00
kibromg11-Jul-07 4:00 
AnswerRe: Display Multiple Columns in a List Box Pin
Michael Sync11-Jul-07 7:59
Michael Sync11-Jul-07 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.