hi,
for your first answer here is the solution:
Dim conn As System.Data.SqlClient.SqlConnection
Dim cmd As System.Data.SqlClient.SqlCommand
Dim cmdString As String = "select [column name] from [table name] where (([column name] = @Username) and ([Password] = @Password))"
conn =
New SqlConnection("Data Source String")
cmd =
New SqlCommand(cmdString, conn)
cmd.Parameters.Add((
"@Username"), SqlDbType.Decimal, 9)
cmd.Parameters(
"@Username").Value = TextBox.Text (textbox to compare with database)
cmd.Parameters.Add((
"@Password"), SqlDbType.Decimal, 9)
cmd.Parameters("@Password").Value = TextBox.Text (textbox to compare with database)
conn.Open()
Dim
myReader As SqlDataReader
myReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If myReader.Read() Then FormsAuthentication.RedirectFromLoginPage(TextBox.Text, False)
Else
label.Text =
"Invalid Id or Password"
End If
myReader.Close()
End Sub
for the rest i will catch you later.
first try this
please mark the answer, as this will help others to find solution