View Single Post
  #7 (permalink)  
Old January 23rd, 2007, 12:30 PM
keyvanjan keyvanjan is offline
Friend of Wrox
 
Join Date: May 2005
Location: , , .
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am really confused
what should i write in the parameters collection
i have this code

Dim strSQL3 As String
        Dim sql As String = "Select password from members_bkp"
        Dim cnn As New SqlClient.SqlConnection(strConnection)
        cnn.Open()
        Dim Cmd As New SqlCommand(sql, cnn)


        strSQL3 = "UPDATE members_bkp set password=@pwd"
        Cmd = New SqlCommand(strSQL3, cnn)


        Cmd.Parameters.Add(New SqlParameter("@pwd", dr("password")))
        dr = Cmd.ExecuteReader()
        While dr.Read()
            Dim strPWEncoded As String = FormsAuthentication.HashPasswordForStoringInConfig File(dr("password"), "SHA1")
            Cmd.Parameters.Add(New SqlParameter("@pwd", strPWEncoded))
            Cmd.ExecuteNonQuery()
        End While
        dr.Close()



Reply With Quote