There was no homework portion to this assignment.
For this solution, I modified the login code from project #11 as follows. Note that I've used a dataset here - perhaps a datareader would be more appropriate given that we're only reading the password.
Private Sub LoginBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginBtn.Click
Feedback.Text = ""
Dim DataSet1 As New DataSet
Dim aRow As DataRow
Me.SqlSelectCommand1.CommandText = "SELECT password FROM Customers WHERE loginid='" + LoginID.Text + "'"
Me.SqlDataAdapter1.Fill(DataSet1, "dsPassword")
If DataSet1.Tables("dsPassword").Rows.Count = 1 Then
aRow = DataSet1.Tables("dsPassword").Rows.Item(0)
If (System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "md5") = aRow("password")) Then
Session("loginID") = LoginID.Text
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(LoginID.Text, False)
Else
Feedback.Text = "Invalid password..."
End If
Else
Feedback.Text = "Unknown user..."
End If
End Sub
The code to create the HTML table filled with data from the database is covered in detail in the lecture notes.