Menu

Tuesday, March 22, 2011

Login in ASP.Net in VB using ADO.Net Entity Data Model


STEP 01:(Create the Module)
Public Module Class1
    Public conn As New TestingDatabesModel.TestingDatabesEntities
End Module


STEP 02:(Type The Code On Button(Login) Click)
        Dim LoginUser = conn.UserTables.FirstOrDefault(Function(f1) f1.UserName = txtUsername.Text And    f1.Password = txtPassword.Text)
        If LoginUser Is Nothing Then
            My.Response.Write("Invalid UserName/Password")
        Else
            My.Response.Redirect("Pages/Welcome.aspx")
        End If
    End Sub

No comments:

Post a Comment