3 Replies - 1335 Views - Last Post: 05 August 2010 - 01:07 AM Rate Topic: -----

#1 alan025   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 20-July 10

Login page code Error

Posted 04 August 2010 - 03:42 AM

I am creating a login page using Vb.net ... i have written coding but it shows some Error ..
Here is mine coding ..
..
 Dim DataClass As New DataClassesDataContext
        Dim l = From Users In  DataClass.Users _
        Where (Function(x) x.UserName = txtUserName.Text  
              And x.Password = txtPassword.Text).ToList  
        If l.Count = 1 Then
            Session("username") = txtUserName.Text
            Response.Redirect("Masters.aspx")
        Else
            lb(Msg.Text =("Invalid Login!")

        End If


...

I am having Error on line 3 , 4 and 7 ..i think the function i created is right ..but it shows errors

Could any one guide me ..

Thank you

Is This A Good Question/Topic? 0
  • +

Replies To: Login page code Error

#2 alan025   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 20-July 10

Re: Login page code Error

Posted 04 August 2010 - 05:29 AM

ohh ..why no replies still .. :helpsmilie:
Was This Post Helpful? 0
  • +
  • -

#3 Jayman   User is offline

  • Student of Life
  • member icon

Reputation: 423
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Login page code Error

Posted 04 August 2010 - 08:19 AM

Can you post the error messages that you are receiving?
Was This Post Helpful? 0
  • +
  • -

#4 alan025   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 14
  • Joined: 20-July 10

Re: Login page code Error

Posted 05 August 2010 - 01:07 AM

View PostJayman, on 04 August 2010 - 07:19 AM, said:

Can you post the error messages that you are receiving?


now its working fine after I rearranged the code like below

..

Dim l = (From Users In DataClass.Users _
Where Users.UserName = txtUserName.Text _
And Users.Password = txtPassword.Text).ToList
...

also Now i want to display something on the incorrect login ie if the user puts some wrong password or username .. some notifications have to appear.. like invalid login or register first

could u pls guide with that ..

This post has been edited by alan025: 05 August 2010 - 01:17 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1